From patchwork Fri Dec 10 20:52:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 15124 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 67BFCBF415 for ; Fri, 10 Dec 2021 20:51:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 817BE60868; Fri, 10 Dec 2021 21:51:53 +0100 (CET) Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C83D760868 for ; Fri, 10 Dec 2021 21:51:51 +0100 (CET) Received: (Authenticated sender: jacopo@jmondi.org) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 2D9D4100007; Fri, 10 Dec 2021 20:51:51 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Fri, 10 Dec 2021 21:52:29 +0100 Message-Id: <20211210205239.354901-2-jacopo@jmondi.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211210205239.354901-1-jacopo@jmondi.org> References: <20211210205239.354901-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 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; }