From patchwork Tue Dec 13 09:15:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17990 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 64266C328D for ; Tue, 13 Dec 2022 09:16:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 20F566336F; Tue, 13 Dec 2022 10:16:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1670922984; bh=uLbS2MMYkwciYvkiMPsKpj+TkPQQbhGuKbcAlM5zBuk=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=qAKHkYtgfTuQxxZXIScUmNhxctTmp9HWmvxcM0W9eItbmmXe+pr5o1tLyCpSIducF +314kLIczVRn9tHYrGG7wiAt6MkDb8cRt1ddMzE0zcw3HYUufrgSi/tZ9frstT6SDY 9BQq5NraiNHPjMEbjhPanDYnKQtWAD73J2kHTN5/I3gua4PXAUkWc0HNShZ5UWZcLt OGGoFX8n479qM2givNtkNz9re5MpqJoSofJilytaCH/MxyaBHheoaktOzUCzuSele7 u1W7yZogbK3tm/1LwipClzc5QrhlR2fu6OxV+lIEEOfJOd58daDX9YmdDJKViJcXeQ ajYTajIEk57gA== 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 726A66336F for ; Tue, 13 Dec 2022 10:16:22 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="kTevQmIL"; dkim-atps=neutral Received: from pyrite.tail37cf.ts.net (h175-177-042-159.catv02.itscom.jp [175.177.42.159]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2A61B4A7; Tue, 13 Dec 2022 10:16:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1670922982; bh=uLbS2MMYkwciYvkiMPsKpj+TkPQQbhGuKbcAlM5zBuk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kTevQmILo9vAv/6K8XnddfE4qQp26T9c8OQIfCnkP5QVn4wftVS+R4KWeUza20OOu EHMtFSl4S7xljNID+owfQDW3LzQfq2Mjg6yAIlOISP6b2S2KJG13xI2XoYcGHcp6pn gzcr+i/224R7W8Nv5/oe/Wqh1T/SlTDVFi0luQwA= To: libcamera-devel@lists.libcamera.org Date: Tue, 13 Dec 2022 18:15:58 +0900 Message-Id: <20221213091558.621950-8-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221213091558.621950-1-paul.elder@ideasonboard.com> References: <20221213091558.621950-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 7/7] tracepoints: pipeline: Add tracepoint for bufferReady 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: , X-Patchwork-Original-From: Paul Elder via libcamera-devel From: Paul Elder Reply-To: Paul Elder Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a tracepoint to track bufferReady. Only the Request address is printed and not Request information, to prevent dereferencing a potentially nullptr request. Signed-off-by: Paul Elder --- New in v2 --- .../libcamera/internal/tracepoints/pipeline.tp | 18 ++++++++++++++++++ src/libcamera/pipeline/vimc/vimc.cpp | 3 +++ 2 files changed, 21 insertions(+) diff --git a/include/libcamera/internal/tracepoints/pipeline.tp b/include/libcamera/internal/tracepoints/pipeline.tp index 71694dd4..c623683a 100644 --- a/include/libcamera/internal/tracepoints/pipeline.tp +++ b/include/libcamera/internal/tracepoints/pipeline.tp @@ -5,6 +5,9 @@ * pipeline.tp - Tracepoints for pipelines */ +#include +#include + #include "libcamera/internal/pipeline_handler.h" TRACEPOINT_EVENT( @@ -43,3 +46,18 @@ TRACEPOINT_EVENT( ctf_string(name, pipe->name()) ) ) + +TRACEPOINT_EVENT( + libcamera, + pipe_buffer_ready, + TP_ARGS( + libcamera::PipelineHandler *, pipe, + libcamera::FrameBuffer *, buf, + libcamera::Request *, req + ), + TP_FIELDS( + ctf_integer_hex(uintptr_t, buffer, reinterpret_cast(buf)) + ctf_enum(libcamera, buffer_status, uint32_t, buf_status, buf->metadata().status) + ctf_integer_hex(uintptr_t, request, reinterpret_cast(req)) + ) +) diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp index 204f5ad7..79c401e7 100644 --- a/src/libcamera/pipeline/vimc/vimc.cpp +++ b/src/libcamera/pipeline/vimc/vimc.cpp @@ -36,6 +36,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/v4l2_subdevice.h" #include "libcamera/internal/v4l2_videodevice.h" @@ -577,6 +578,8 @@ int VimcCameraData::init() void VimcCameraData::bufferReady(FrameBuffer *buffer) { + LIBCAMERA_TRACEPOINT(pipe_buffer_ready, this->pipe(), buffer, buffer->request()); + PipelineHandlerVimc *pipe = static_cast(this->pipe()); Request *request = buffer->request();