From patchwork Sat Dec 11 16:57:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 15136 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 166E5BDB13 for ; Sat, 11 Dec 2021 16:56:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B4DF4608A5; Sat, 11 Dec 2021 17:56:28 +0100 (CET) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 92B2160113 for ; Sat, 11 Dec 2021 17:56:25 +0100 (CET) Received: (Authenticated sender: jacopo@jmondi.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id F30FB20007; Sat, 11 Dec 2021 16:56:24 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Sat, 11 Dec 2021 17:57:04 +0100 Message-Id: <20211211165714.23067-2-jacopo@jmondi.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211211165714.23067-1-jacopo@jmondi.org> References: <20211211165714.23067-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 01/11] libcamera: Print Timer identifier 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" The Timer debug output does not report to which timer a condition refers to. Fix that by printing the Timer address. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/base/event_dispatcher_poll.cpp | 3 ++- src/libcamera/base/timer.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libcamera/base/event_dispatcher_poll.cpp b/src/libcamera/base/event_dispatcher_poll.cpp index 8ee22d5adcc4..7238a3165da8 100644 --- a/src/libcamera/base/event_dispatcher_poll.cpp +++ b/src/libcamera/base/event_dispatcher_poll.cpp @@ -214,7 +214,8 @@ int EventDispatcherPoll::poll(std::vector *pollfds) timeout = { 0, 0 }; LOG(Event, Debug) - << "timeout " << timeout.tv_sec << "." + << "next timer " << nextTimer << " expires in " + << timeout.tv_sec << "." << std::setfill('0') << std::setw(9) << timeout.tv_nsec; } diff --git a/src/libcamera/base/timer.cpp b/src/libcamera/base/timer.cpp index 9c54352d46bd..187336e3a1a4 100644 --- a/src/libcamera/base/timer.cpp +++ b/src/libcamera/base/timer.cpp @@ -96,7 +96,7 @@ void Timer::start(std::chrono::milliseconds duration) void Timer::start(std::chrono::steady_clock::time_point deadline) { if (Thread::current() != thread()) { - LOG(Timer, Error) << "Timer can't be started from another thread"; + LOG(Timer, Error) << "Timer " << this << " << can't be started from another thread"; return; } @@ -128,7 +128,7 @@ void Timer::stop() return; if (Thread::current() != thread()) { - LOG(Timer, Error) << "Timer can't be stopped from another thread"; + LOG(Timer, Error) << "Timer " << this << " can't be stopped from another thread"; return; }