From patchwork Tue Oct 12 01:09:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 14102 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 6C7D8BDC71 for ; Tue, 12 Oct 2021 01:09:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E2A766027F; Tue, 12 Oct 2021 03:09:51 +0200 (CEST) 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="IXoFfUcx"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2D20E6027A for ; Tue, 12 Oct 2021 03:09:50 +0200 (CEST) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A73EDF1 for ; Tue, 12 Oct 2021 03:09:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1634000989; bh=DpFatmifT1B6cA+iJ6DzSC7cY5fyjYGrxC8J45M3ExQ=; h=From:To:Subject:Date:From; b=IXoFfUcxJ8/ckSgHpuI+C3X+SbXDyMxfKwdSnk4vy3emakd2gD5oC5G4lViRUzBNy tU2Cs+p9oEh7w+qEr+fzRPWObCWitMlHFJy/7tE9UBevpnr5Ww7AI2ZZCZCnK+gKgl CbDNlsenreE4gP4lVyJgY6Ij1WQ/pmSZCbI5hYRI= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Tue, 12 Oct 2021 04:09:32 +0300 Message-Id: <20211012010932.15873-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: media_device: Print link information when setup fails 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" When setting up a link fails, the error message doesn't specify which link is being acted on. This makes debugging more difficult than it should be. Improve the message by printing the link information. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/media_device.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) base-commit: fa7a95bf32c6a8ee87b67159d4238cbc8e6dc3a9 diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp index ccaf039ba7a9..aa93da75c593 100644 --- a/src/libcamera/media_device.cpp +++ b/src/libcamera/media_device.cpp @@ -803,7 +803,11 @@ int MediaDevice::setupLink(const MediaLink *link, unsigned int flags) if (ret) { ret = -errno; LOG(MediaDevice, Error) - << "Failed to setup link: " + << "Failed to setup link " + << source->entity()->name() << "[" + << source->index() << "] -> " + << sink->entity()->name() << "[" + << sink->index() << "]: " << strerror(-ret); return ret; }