From patchwork Tue Dec 13 09:15:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17984 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 4B9F6C328D for ; Tue, 13 Dec 2022 09:16:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E116663354; Tue, 13 Dec 2022 10:16:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1670922974; bh=AWwks3MUmdCPKcHt5f+555qCTZBdaS1XjdE7e3U70P4=; 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=oVAt1dLFQFfpym+RdGk5IZu6YgQB8oVwxN2vDW6t9zPxZ84nQqeI7NSg8Vw15UNJe nXl5F2aKEKDQKFgAzzEABs1lOWaLXjLWtnGItIgD5bNZUuPp9md2H4U6pIL/Y1Ahgt ZXt3nXGmAz2YFPIK5yJZw55J0KvJQJgSlN26743lOQ7S1q2CB1sIyTpbujsspK1N4n DqdebXMWwHvfw4KdjJHYUD/XYrDyu+4So0gSMMKOpSZ3UIt8gAc4XIvMjkr6wrVwwH tj50itN+PZeWsw+nMed7EKKZ45yXU7/8mXKDBJw/qJXRUqYWc2ZDAqtVhHtjGAlxGA 2HeOaHoH6dPng== 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 E14F563354 for ; Tue, 13 Dec 2022 10:16:12 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="SZRVO9NZ"; 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 AABC87C5; Tue, 13 Dec 2022 10:16:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1670922972; bh=AWwks3MUmdCPKcHt5f+555qCTZBdaS1XjdE7e3U70P4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SZRVO9NZQ5WrxwymBcp2G2zYCoYtXYKnTgx/fh/gJtekx3XwK/+nKLv258WCOIG8Y 5f7+sMz9/vMcuydUkwUOV0hmXujReITBzQkfvBdBgjLvAxx4llaG7oZgQlGCtNGVpN AAHjsUBUaglBg4XGoQCXFirRpetMkINDs2k9MNn8= To: libcamera-devel@lists.libcamera.org Date: Tue, 13 Dec 2022 18:15:52 +0900 Message-Id: <20221213091558.621950-2-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 1/7] tracepoints: request: Use public Request pointer in all 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: , 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" Make all tracepoints use the public Request pointer instead of some of them using the Private one. This makes it easier to track the Requests in a trace. Signed-off-by: Paul Elder --- New in v2 --- include/libcamera/internal/tracepoints/request.tp | 7 +++---- src/libcamera/request.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/libcamera/internal/tracepoints/request.tp b/include/libcamera/internal/tracepoints/request.tp index f1e54497..9d0bcbfa 100644 --- a/include/libcamera/internal/tracepoints/request.tp +++ b/include/libcamera/internal/tracepoints/request.tp @@ -5,9 +5,8 @@ * request.tp - Tracepoints for the request object */ -#include - #include +#include TRACEPOINT_EVENT_CLASS( libcamera, @@ -72,7 +71,7 @@ TRACEPOINT_EVENT_INSTANCE( request, request_complete, TP_ARGS( - libcamera::Request::Private *, req + libcamera::Request *, req ) ) @@ -81,7 +80,7 @@ TRACEPOINT_EVENT_INSTANCE( request, request_cancel, TP_ARGS( - libcamera::Request::Private *, req + libcamera::Request *, req ) ) diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index 949c556f..1dedc26e 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -121,7 +121,7 @@ void Request::Private::complete() LOG(Request, Debug) << request->toString(); - LIBCAMERA_TRACEPOINT(request_complete, this); + LIBCAMERA_TRACEPOINT(request_complete, request); } void Request::Private::doCancelRequest() @@ -149,9 +149,10 @@ void Request::Private::doCancelRequest() */ void Request::Private::cancel() { - LIBCAMERA_TRACEPOINT(request_cancel, this); - Request *request = _o(); + + LIBCAMERA_TRACEPOINT(request_cancel, request); + ASSERT(request->status() == RequestPending); doCancelRequest(); From patchwork Tue Dec 13 09:15:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17985 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 B8BC3BDE6B for ; Tue, 13 Dec 2022 09:16:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7F5E563365; Tue, 13 Dec 2022 10:16:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1670922977; bh=LdQhdsnyjvNC3yubUJqkWKOK9I0vrWbE5UsIW42V+g0=; 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=hthZk1xa5Ubrcb5V/Y/cwqtYK4n21X2onYraiAk5qUCUWFTDKlnlDiHpKXnVmqE8F Xw1/k3Ekr+gzNRWGB6UCksY9dBFOZvEGMRy9cWs4/N8V3xphIDMxhaHzDbmPlTi2gv 3kUtRUMc/9ckJfY/zwWcOSuqkGw91wlxANsvLxxiht3hyNtyHoUWEMatGcdrqYEtZb y4KV0v9GrwLyEj804ggPODQnzHRC+2G9T2bbYK1OrTIXNJ8pq9SgatzQEalZaFHcx+ VmJfK1o/Yrhr6HNGc+Z1iQuPzDyE0OJD2HCHBUG3xNptPMAr3GJMEeIgw8nWU3eRXt k76HIz2sj1h2w== 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 78FAC63362 for ; Tue, 13 Dec 2022 10:16:14 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="PA2iXPHv"; 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 406904A7; Tue, 13 Dec 2022 10:16:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1670922974; bh=LdQhdsnyjvNC3yubUJqkWKOK9I0vrWbE5UsIW42V+g0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PA2iXPHvQS/un3N5ty3cRK9C3uvpYRaDalQJdLeqyrz0tHVUXJEhff6cuIH+9Dk2B mhNX6dAeq3t7avp+Dp6aO7MfI9byBS9n5Cf/pYTOnRQ0exuPXrVBUETZ7X8coD/7xK EsHIw1oLk1cIuZ6Ika4P6/RPWHDCnoiZO0VFSPN4= To: libcamera-devel@lists.libcamera.org Date: Tue, 13 Dec 2022 18:15:53 +0900 Message-Id: <20221213091558.621950-3-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 2/7] tracepoints: request: Add event class for request and buffer 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" Currently there is one tracepoint event request_complete_buffer that outputs information on both the request and its buffer. We want to add another event for add_buffer. Add an event class to cover this. Signed-off-by: Paul Elder --- Changes in v2: - Change arg from private to public Request pointer --- .../libcamera/internal/tracepoints/request.tp | 28 +++++++++++++------ src/libcamera/request.cpp | 2 +- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/include/libcamera/internal/tracepoints/request.tp b/include/libcamera/internal/tracepoints/request.tp index 9d0bcbfa..b295b44f 100644 --- a/include/libcamera/internal/tracepoints/request.tp +++ b/include/libcamera/internal/tracepoints/request.tp @@ -21,6 +21,22 @@ TRACEPOINT_EVENT_CLASS( ) ) +TRACEPOINT_EVENT_CLASS( + libcamera, + request_with_buffer, + TP_ARGS( + libcamera::Request*, req, + libcamera::FrameBuffer *, buf + ), + TP_FIELDS( + ctf_integer_hex(uintptr_t, request, reinterpret_cast(req)) + ctf_integer(uint64_t, cookie, req->cookie()) + ctf_integer(int, status, req->status()) + ctf_integer_hex(uintptr_t, buffer, reinterpret_cast(buf)) + ctf_enum(libcamera, buffer_status, uint32_t, buf_status, buf->metadata().status) + ) +) + TRACEPOINT_EVENT_INSTANCE( libcamera, request, @@ -84,18 +100,12 @@ TRACEPOINT_EVENT_INSTANCE( ) ) -TRACEPOINT_EVENT( +TRACEPOINT_EVENT_INSTANCE( libcamera, + request_with_buffer, request_complete_buffer, TP_ARGS( - libcamera::Request::Private *, req, + libcamera::Request *, req, libcamera::FrameBuffer *, buf - ), - TP_FIELDS( - ctf_integer_hex(uintptr_t, request, reinterpret_cast(req)) - ctf_integer(uint64_t, cookie, req->_o()->cookie()) - ctf_integer(int, status, req->_o()->status()) - ctf_integer_hex(uintptr_t, buffer, reinterpret_cast(buf)) - ctf_enum(libcamera, buffer_status, uint32_t, buf_status, buf->metadata().status) ) ) diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index 1dedc26e..652b7b70 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -90,7 +90,7 @@ bool Request::Private::hasPendingBuffers() const */ bool Request::Private::completeBuffer(FrameBuffer *buffer) { - LIBCAMERA_TRACEPOINT(request_complete_buffer, this, buffer); + LIBCAMERA_TRACEPOINT(request_complete_buffer, _o(), buffer); int ret = pending_.erase(buffer); ASSERT(ret == 1); From patchwork Tue Dec 13 09:15:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17986 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 A3FF1C328D for ; Tue, 13 Dec 2022 09:16:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1BE3163368; Tue, 13 Dec 2022 10:16:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1670922978; bh=lfft24zg/Os7CpJbn9HlIhwaI0PWX2xuE9iJsGAKZHw=; 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=ITn5ula7ELXJpukO+wbI1gS1q22jR+ChtJQeolrOBwfirLfkJ7mxsyqilFN8DDdrF bfI0ECX4G8PqsqkcgGAjGdIPBipbIJfWuMJkd7j8Szz8E9TzAV+34J+QHYjphlJ3Bh CqmjCWZ0GWyxOv3oOsQgsXY/GW0dAWiQn3o3Xyravi+tespHWrsQvgp9oWcXldkD09 3WdabWB4sX9CS/Pidp4LACx8KHBPdKFwZghmP00SFuWRQGm0mFPTphrrFpyDgIQK41 Fzp5ulCxoDTApA5x9UQga88fNcZAhAslbNOh5BZElaImnoZ+VoAVCxJsTAuFONj4DH UKEbzNu/RrFOQ== 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 0F0FE63361 for ; Tue, 13 Dec 2022 10:16:16 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="qXB9jcxg"; 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 CA1E3AFC; Tue, 13 Dec 2022 10:16:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1670922975; bh=lfft24zg/Os7CpJbn9HlIhwaI0PWX2xuE9iJsGAKZHw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qXB9jcxgZrTsdrxRAIZVIcN/jJ23GWWdytZAVEbpTHjTvTWdL2c+mWVBlarrZ5jrb CrJP0bfUZov9jDvTZuNFI034aSWooYOlfjjA1hnhykmHucQtZ17pEwS0F4lp3NLQ0a 1LAR2zFKPPD6x+IFEoe72xcOA64Jd1cf4vThH2+4= To: libcamera-devel@lists.libcamera.org Date: Tue, 13 Dec 2022 18:15:54 +0900 Message-Id: <20221213091558.621950-4-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 3/7] tracepoints: request: Add tracepoint for addBuffer 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 event request_add_buffer for tracing Request::addBuffer(). Signed-off-by: Paul Elder --- Changes in v2: - Change arg from private to public Request pointer --- include/libcamera/internal/tracepoints/request.tp | 10 ++++++++++ src/libcamera/request.cpp | 2 ++ 2 files changed, 12 insertions(+) diff --git a/include/libcamera/internal/tracepoints/request.tp b/include/libcamera/internal/tracepoints/request.tp index b295b44f..e0ac45ac 100644 --- a/include/libcamera/internal/tracepoints/request.tp +++ b/include/libcamera/internal/tracepoints/request.tp @@ -100,6 +100,16 @@ TRACEPOINT_EVENT_INSTANCE( ) ) +TRACEPOINT_EVENT_INSTANCE( + libcamera, + request_with_buffer, + request_add_buffer, + TP_ARGS( + libcamera::Request *, req, + libcamera::FrameBuffer *, buf + ) +) + TRACEPOINT_EVENT_INSTANCE( libcamera, request_with_buffer, diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index 652b7b70..226c26b7 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -463,6 +463,8 @@ void Request::reuse(ReuseFlag flags) int Request::addBuffer(const Stream *stream, FrameBuffer *buffer, std::unique_ptr fence) { + LIBCAMERA_TRACEPOINT(request_add_buffer, this, buffer); + if (!stream) { LOG(Request, Error) << "Invalid stream reference"; return -EINVAL; From patchwork Tue Dec 13 09:15:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17987 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 86060BDE6B for ; Tue, 13 Dec 2022 09:16:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2FAF563370; Tue, 13 Dec 2022 10:16:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1670922981; bh=9HxgRXXTRU6iVRfwvCV88S566SAWuWSskXAEAD5+FM0=; 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=gbxkmra/ITR9m+mjv9D60OTSww2Ir/338v3c39GXrzMzTMNeZW9Bu/i+sblbeO9O+ FV/KndrElzBb7a9BB/JVKsbAWy5kr1yNo1AIN+7Sdobi0ROFU1g+b6J1vrCMFcU2I8 feXaOZM2FvmzzvD5hl5UsvbYM2So1x/K5VGFn2nuOPV+JWiAJ+YwbJ7O6lAkJuC2V+ r/bK2qsQsdgcbByb5KABLWQgciNCPphklQygGyTpNA2j0161xXiznNbJnBjR3qKgka SyUn0g+EoTEOLD73ttqtWPhapBHKYvzvUkXE2MyXAfcE4oi7DG0GxWQEfXCyHiOPrb 6ALdKUNiFXs3A== 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 C87946336B for ; Tue, 13 Dec 2022 10:16:17 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="mLQ4E4v2"; 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 621637C5; Tue, 13 Dec 2022 10:16:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1670922977; bh=9HxgRXXTRU6iVRfwvCV88S566SAWuWSskXAEAD5+FM0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mLQ4E4v2PawjfibhD/sNiiVX5Goe9u27dIO1EZ8D3lerbR8VS5mbyU5re5shNQF3M sxhDY9TBNv94fbTaeVcWma6futYqN9Hjp/pxoM/0+SKrswunPOhQZs+9qHXSJjmpRI HiPApkEcBhoHckCUVihWPTuw6fF8sloO9QnOeylw= To: libcamera-devel@lists.libcamera.org Date: Tue, 13 Dec 2022 18:15:55 +0900 Message-Id: <20221213091558.621950-5-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 4/7] tracepoints: request: Add flags to request_reuse tracepoint 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 flags to the fields of the tracepoint event request_reuse. This causes it to be no longer able to use the event class, which is why it has to list the fields again. Signed-off-by: Paul Elder --- New in v2 --- .../libcamera/internal/tracepoints/request.tp | 24 ++++++++++++------- src/libcamera/request.cpp | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/include/libcamera/internal/tracepoints/request.tp b/include/libcamera/internal/tracepoints/request.tp index e0ac45ac..c1623586 100644 --- a/include/libcamera/internal/tracepoints/request.tp +++ b/include/libcamera/internal/tracepoints/request.tp @@ -55,15 +55,6 @@ TRACEPOINT_EVENT_INSTANCE( ) ) -TRACEPOINT_EVENT_INSTANCE( - libcamera, - request, - request_reuse, - TP_ARGS( - libcamera::Request *, req - ) -) - TRACEPOINT_EVENT_INSTANCE( libcamera, request, @@ -119,3 +110,18 @@ TRACEPOINT_EVENT_INSTANCE( libcamera::FrameBuffer *, buf ) ) + +TRACEPOINT_EVENT( + libcamera, + request_reuse, + TP_ARGS( + libcamera::Request *, req, + enum libcamera::Request::ReuseFlag, flags + ), + TP_FIELDS( + ctf_integer_hex(uintptr_t, request, reinterpret_cast(req)) + ctf_integer(uint64_t, cookie, req->cookie()) + ctf_enum(libcamera, request_status, uint32_t, status, req->status()) + ctf_integer_hex(uint32_t, flags, static_cast(flags)) + ) +) diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index 226c26b7..5a127f06 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -382,7 +382,7 @@ Request::~Request() */ void Request::reuse(ReuseFlag flags) { - LIBCAMERA_TRACEPOINT(request_reuse, this); + LIBCAMERA_TRACEPOINT(request_reuse, this, flags); _d()->reset(); From patchwork Tue Dec 13 09:15:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17988 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 23D54C328D for ; Tue, 13 Dec 2022 09:16:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D00B96336E; Tue, 13 Dec 2022 10:16:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1670922981; bh=RBr4bT1bI9efjqqwFc9pjDaNt8QG7v1WHc89a0WZTv0=; 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=ZABTxtygFOaOj/YlNuxYNE5VJY/mxbVNUa8B/NHy+l6sMtz9ahg9nJIKwIWnqCbwM 95jTvH4TUs4TSn9qyQMLlJsrJa/LypjuWWDCxSiLAhVXMs8sXcsIx6LlGf2XjmdPif jnRygntfTIUKH/o97wWm/QbunRUT21o6TGxEmSGXC2RawG3JXUwrPhFLZ8nggQgitc 0gSS29O0YHsF/czpfblS0wyf7O/EmSCuXdxBhubQTUpjASXrruiMzT0bMCN2qFbPBZ YwTqAsZ9lwzfJg9Y+sG1S128O+7RR9Ox4QQyyyhFj/Z5PhDJl+BJBoT7I2Nr7mO4y7 HiK2/N17kpBlA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 33B3363362 for ; Tue, 13 Dec 2022 10:16:19 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="uUtdpQN0"; 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 EC5164A7; Tue, 13 Dec 2022 10:16:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1670922978; bh=RBr4bT1bI9efjqqwFc9pjDaNt8QG7v1WHc89a0WZTv0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uUtdpQN0MkHU7Bp9tIdXNj0qjMg8FUbdN4AIp+fcY8ZQiUi7fqzS3Ksu5VI42LxxE CXcBVClCYcuVJKkO/ITFZ87Qttrnss4XKrkfM3udnMYDTser56wQIzJuI9SHZ+1Pb+ TqHg+6JtpJPm1IeNdVwP0gfmQRt+H3mrQCWerkFE= To: libcamera-devel@lists.libcamera.org Date: Tue, 13 Dec 2022 18:15:56 +0900 Message-Id: <20221213091558.621950-6-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 5/7] tracepoints: v4l2: Add tracepoints for tracking buffer lifetime 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 tracepoints in V4L2VideoDevice for tracing the lifetime of libcamera FrameBuffers. Signed-off-by: Paul Elder --- New in v2 --- .../internal/tracepoints/meson.build | 2 + .../libcamera/internal/tracepoints/v4l2.tp | 77 +++++++++++++++++++ .../internal/tracepoints/v4l2_enums.tp | 16 ++++ src/libcamera/v4l2_videodevice.cpp | 9 +++ 4 files changed, 104 insertions(+) create mode 100644 include/libcamera/internal/tracepoints/v4l2.tp create mode 100644 include/libcamera/internal/tracepoints/v4l2_enums.tp diff --git a/include/libcamera/internal/tracepoints/meson.build b/include/libcamera/internal/tracepoints/meson.build index d9b2fca5..83f1144b 100644 --- a/include/libcamera/internal/tracepoints/meson.build +++ b/include/libcamera/internal/tracepoints/meson.build @@ -4,9 +4,11 @@ tracepoint_files = files([ 'buffer_enums.tp', 'request_enums.tp', + 'v4l2_enums.tp', ]) tracepoint_files += files([ 'pipeline.tp', 'request.tp', + 'v4l2.tp', ]) diff --git a/include/libcamera/internal/tracepoints/v4l2.tp b/include/libcamera/internal/tracepoints/v4l2.tp new file mode 100644 index 00000000..f80eeb30 --- /dev/null +++ b/include/libcamera/internal/tracepoints/v4l2.tp @@ -0,0 +1,77 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2022, Paul Elder + * + * v4l2.tp - Tracepoints for V4L2 devices + */ + +#include +#include + +#include "libcamera/internal/v4l2_device.h" +#include "libcamera/internal/v4l2_videodevice.h" + +TRACEPOINT_EVENT_CLASS( + libcamera, + v4l2_with_buffer, + TP_ARGS( + libcamera::V4L2VideoDevice *, vdev, + libcamera::FrameBuffer *, buf + ), + TP_FIELDS( + ctf_string(devnode, vdev->deviceNode().c_str()) + ctf_integer_hex(uintptr_t, buffer, reinterpret_cast(buf)) + ctf_enum(libcamera, buffer_status, uint32_t, buf_status, buf->metadata().status) + ) +) + +TRACEPOINT_EVENT( + libcamera, + v4l2_videodev_streamoff, + TP_ARGS( + libcamera::V4L2VideoDevice *, vdev, + uint32_t, stream_state, + uint32_t, queued_buffers_size + ), + TP_FIELDS( + ctf_string(devnode, vdev->deviceNode().c_str()) + ctf_enum(libcamera, v4l2_streaming_state, uint32_t, state, stream_state) + ctf_integer(uint32_t, queued_buffers, queued_buffers_size) + ) +) + +TRACEPOINT_EVENT( + libcamera, + v4l2_videodev_send_back_buffer, + TP_ARGS( + libcamera::V4L2VideoDevice *, vdev, + libcamera::FrameBuffer *, buf, + libcamera::Request *, req + ), + TP_FIELDS( + ctf_string(devnode, vdev->deviceNode().c_str()) + 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)) + ) +) + +TRACEPOINT_EVENT_INSTANCE( + libcamera, + v4l2_with_buffer, + v4l2_videodev_add_buffer_to_queue, + TP_ARGS( + libcamera::V4L2VideoDevice *, vdev, + libcamera::FrameBuffer *, buf + ) +) + +TRACEPOINT_EVENT_INSTANCE( + libcamera, + v4l2_with_buffer, + v4l2_videodev_remove_buffer_from_queue, + TP_ARGS( + libcamera::V4L2VideoDevice *, vdev, + libcamera::FrameBuffer *, buf + ) +) diff --git a/include/libcamera/internal/tracepoints/v4l2_enums.tp b/include/libcamera/internal/tracepoints/v4l2_enums.tp new file mode 100644 index 00000000..38506e17 --- /dev/null +++ b/include/libcamera/internal/tracepoints/v4l2_enums.tp @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2022, Paul Elder + * + * v4l2_enums.tp - Tracepoint definition for enums in V4L2 + */ + +TRACEPOINT_ENUM( + libcamera, + v4l2_streaming_state, + TP_ENUM_VALUES( + ctf_enum_value("Streaming", 0) + ctf_enum_value("Stopping", 1) + ctf_enum_value("Stopped", 2) + ) +) diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 1051997e..b134b0d4 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -31,6 +31,7 @@ #include "libcamera/internal/framebuffer.h" #include "libcamera/internal/media_device.h" #include "libcamera/internal/media_object.h" +#include "libcamera/internal/tracepoints.h" /** * \file v4l2_videodevice.h @@ -1706,6 +1707,7 @@ int V4L2VideoDevice::queueBuffer(FrameBuffer *buffer) watchdog_.start(std::chrono::duration_cast(watchdogDuration_)); } + LIBCAMERA_TRACEPOINT(v4l2_videodev_add_buffer_to_queue, this, buffer); queuedBuffers_[buf.index] = buffer; return 0; @@ -1786,6 +1788,7 @@ FrameBuffer *V4L2VideoDevice::dequeueBuffer() cache_->put(buf.index); FrameBuffer *buffer = it->second; + LIBCAMERA_TRACEPOINT(v4l2_videodev_remove_buffer_from_queue, this, buffer); queuedBuffers_.erase(it); if (queuedBuffers_.empty()) { @@ -1930,6 +1933,9 @@ int V4L2VideoDevice::streamOn() */ int V4L2VideoDevice::streamOff() { + LIBCAMERA_TRACEPOINT(v4l2_videodev_streamoff, this, + static_cast(state_), queuedBuffers_.size()); + int ret; if (state_ != State::Streaming && queuedBuffers_.empty()) @@ -1954,6 +1960,9 @@ int V4L2VideoDevice::streamOff() cache_->put(it.first); metadata.status = FrameMetadata::FrameCancelled; + + LIBCAMERA_TRACEPOINT(v4l2_videodev_send_back_buffer, this, buffer, buffer->request()); + bufferReady.emit(buffer); } From patchwork Tue Dec 13 09:15:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17989 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 F1E6CBDE6B for ; Tue, 13 Dec 2022 09:16:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 78A6A63375; Tue, 13 Dec 2022 10:16:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1670922982; bh=+ug6ktsSlZJThflSAuxfjlHlVZCshb4h7SeJHlbDvXg=; 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=tPYfMCd80SIsZs8URC+Kh5xwKi7cnJ2ynGHRAlYzjf+P/r0XyWKagJZZKGs27De3U tobq+wZzT4zo69sfpzba43L4POyTVsfhVrnRYQ17Szp1w73ky+ntc1ruXB0g+9a/Dn evRALDG0lYLU0V0/xJF8EeBv6JLoQftKxXoWjA4wiMY8Uc8OmqMTZTUg4ogD6Z37nq WF5CpFGmnPPr6MgyyO5rHdhuslJ0GiUPGX+mwJ/nKruTpSE8cET8D+dQqpUAFPp1u6 VBP5DsDoetr7Bd5CNHh2PDoqspwEAQ3HA3jOX+2uLiZREwk6H0Oa9wqfIDfoyUvVAn prSE1mU8mbcRg== 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 C38F06336B for ; Tue, 13 Dec 2022 10:16:20 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Ek29poWu"; 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 83CA0AFC; Tue, 13 Dec 2022 10:16:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1670922980; bh=+ug6ktsSlZJThflSAuxfjlHlVZCshb4h7SeJHlbDvXg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ek29poWuFpi01wruJJhC+d3Y5nYhdIIGPUGA93ZWVh61MqWNXpMHuQq6gUdfriWj+ ucrsQNRUytl7jFzDw56cP7xtQ5CSwrJ4QlS+X0C/1q02a+VkigRIok0xpy1I6VSt/o RGNlp8pR4hcGjvUaa1enTRKnNmG5SZVrxfiXs9O8= To: libcamera-devel@lists.libcamera.org Date: Tue, 13 Dec 2022 18:15:57 +0900 Message-Id: <20221213091558.621950-7-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 6/7] tracepoints: pipeline: Add tracepoint for pipe stop 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 for stopping the pipeline. This was used for debugging the segfault caused at camera stop time, where buffers were turning into nullptrs. Signed-off-by: Paul Elder --- New in v2 --- include/libcamera/internal/tracepoints/pipeline.tp | 13 +++++++++++++ src/libcamera/pipeline_handler.cpp | 2 ++ 2 files changed, 15 insertions(+) diff --git a/include/libcamera/internal/tracepoints/pipeline.tp b/include/libcamera/internal/tracepoints/pipeline.tp index 950aa918..71694dd4 100644 --- a/include/libcamera/internal/tracepoints/pipeline.tp +++ b/include/libcamera/internal/tracepoints/pipeline.tp @@ -5,6 +5,8 @@ * pipeline.tp - Tracepoints for pipelines */ +#include "libcamera/internal/pipeline_handler.h" + TRACEPOINT_EVENT( libcamera, ipa_call_begin, @@ -30,3 +32,14 @@ TRACEPOINT_EVENT( ctf_string(function_name, func) ) ) + +TRACEPOINT_EVENT( + libcamera, + pipe_stop, + TP_ARGS( + libcamera::PipelineHandler *, pipe + ), + TP_FIELDS( + ctf_string(name, pipe->name()) + ) +) diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index cfade490..7adb7628 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -326,6 +326,8 @@ void PipelineHandler::unlockMediaDevices() */ void PipelineHandler::stop(Camera *camera) { + LIBCAMERA_TRACEPOINT(pipe_stop, this); + /* Stop the pipeline handler and let the queued requests complete. */ stopDevice(camera); 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();