From patchwork Wed Oct 28 10:31:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 10290 X-Patchwork-Delegate: paul.elder@ideasonboard.com Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 06E98BDB1E for ; Wed, 28 Oct 2020 10:32:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C5146625F5; Wed, 28 Oct 2020 11:32:09 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="vramt9DL"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C3E8B62067 for ; Wed, 28 Oct 2020 11:32:07 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 52F60B95; Wed, 28 Oct 2020 11:32:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1603881127; bh=wwEgF6bKhjW005jowIXVR22ZTCtwzTyTBVkycKHI+eE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vramt9DLeKeJn93hG8aTywhA/fG9Kq3FeV7/mwdAAhi+m/c2cg1w/NHKseRhdcJCH cws+6fxjge5d66hI/ypq1iNhWzX3r2RkQkMdsLuWigugQWzPNZmeosE1Dj/sv6OInk 4qscig00d0E2Ybkf6nnVtFGvcQosZX09v8uhBzc4= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Wed, 28 Oct 2020 19:31:49 +0900 Message-Id: <20201028103151.34575-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201028103151.34575-1-paul.elder@ideasonboard.com> References: <20201028103151.34575-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 4/6] pipeline: raspberrypi: Add IPA call tracepoints X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Emit tracepoints for IPA calls in the raspberrypi pipeline handler, to allow profiling of IPA calls. Signed-off-by: Paul Elder --- New in v2 I was getting compiler complaints when I passed direct strings to the tracepoint without casting... I wasn't getting it in tests... --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 0a5a7288..2de60d3d 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -31,6 +31,7 @@ #include "libcamera/internal/ipa_manager.h" #include "libcamera/internal/media_device.h" #include "libcamera/internal/pipeline_handler.h" +#include "libcamera/internal/tracepoints.h" #include "libcamera/internal/utils.h" #include "libcamera/internal/v4l2_controls.h" #include "libcamera/internal/v4l2_videodevice.h" @@ -1240,6 +1241,8 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config) void RPiCameraData::statsMetadataComplete(uint32_t bufferId, const ControlList &controls) { + LIBCAMERA_TRACEPOINT(ipa_call_finish, (char *)"rpi", (char *)"signalStatReady"); + if (state_ == State::Stopped) handleState(); @@ -1273,6 +1276,8 @@ void RPiCameraData::statsMetadataComplete(uint32_t bufferId, const ControlList & void RPiCameraData::runIsp(uint32_t bufferId) { + LIBCAMERA_TRACEPOINT(ipa_call_finish, (char *)"rpi", (char *)"signalIspPrepare"); + if (state_ == State::Stopped) handleState(); @@ -1406,6 +1411,7 @@ void RPiCameraData::ispOutputDequeue(FrameBuffer *buffer) * application until after the IPA signals so. */ if (stream == &isp_[Isp::Stats]) { + LIBCAMERA_TRACEPOINT(ipa_call_start, (char *)"rpi", (char *)"signalStatReady"); ipa_->signalStatReady(RPi::BufferMask::STATS | static_cast(index)); } else { /* Any other ISP output can be handed back to the application now. */ @@ -1658,7 +1664,9 @@ void RPiCameraData::tryRunPipeline() * queue the ISP output buffer listed in the request to start the HW * pipeline. */ + LIBCAMERA_TRACEPOINT(ipa_call_start, (char *)"rpi", (char *)"signalQueueRequest"); ipa_->signalQueueRequest(request->controls()); + LIBCAMERA_TRACEPOINT(ipa_call_finish, (char *)"rpi", (char *)"signalQueueRequest"); /* Ready to use the buffers, pop them off the queue. */ bayerQueue_.pop(); @@ -1677,6 +1685,7 @@ void RPiCameraData::tryRunPipeline() ipa::rpi::IspPreparePayload ispPrepare; ispPrepare.embeddedbufferId_ = RPi::BufferMask::EMBEDDED_DATA | embeddedId; ispPrepare.bayerbufferId_ = RPi::BufferMask::BAYER_DATA | bayerId; + LIBCAMERA_TRACEPOINT(ipa_call_start, (char *)"rpi", (char *)"signalIspPrepare"); ipa_->signalIspPrepare(ispPrepare); }