From patchwork Mon Feb 18 20:15:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 10818805 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C56391390 for ; Mon, 18 Feb 2019 20:15:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2FD02BAFB for ; Mon, 18 Feb 2019 20:15:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A72232BB37; Mon, 18 Feb 2019 20:15:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DA7D2BAFB for ; Mon, 18 Feb 2019 20:15:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729464AbfBRUPy (ORCPT ); Mon, 18 Feb 2019 15:15:54 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:40862 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728076AbfBRUPx (ORCPT ); Mon, 18 Feb 2019 15:15:53 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id BE5A527F7BE From: Ezequiel Garcia To: linux-media@vger.kernel.org Cc: Hans Verkuil , kernel@collabora.com, Ezequiel Garcia Subject: [PATCH 3/4] media: v4l: Add a module parameter to control global debugging Date: Mon, 18 Feb 2019 17:15:27 -0300 Message-Id: <20190218201528.21545-4-ezequiel@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218201528.21545-1-ezequiel@collabora.com> References: <20190218201528.21545-1-ezequiel@collabora.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In addition to the dev_debug device attribute, which controls per-device debugging, we now add a module parameter to control debugging globally. This will allow to add debugging of v4l2 control logic, using the newly introduced debug parameter. In addition, this module parameter adds consistency to the subsystem, since other v4l2 modules expose the same parameter. Signed-off-by: Ezequiel Garcia --- drivers/media/v4l2-core/v4l2-dev.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c index 35e429ac888f..4f7821b13721 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c @@ -36,8 +36,16 @@ #define VIDEO_NUM_DEVICES 256 #define VIDEO_NAME "video4linux" +unsigned int videodev_debug; +module_param_named(debug, videodev_debug, uint, 0644); + +/* + * The videodev_debug module parameter controls the global debug level, + * while the dev_debug device attribute controls the local + * per-device debug level. + */ #define dprintk(vdev, flags, fmt, arg...) do { \ - if (vdev->dev_debug & flags) \ + if ((videodev_debug & flags) || (vdev->dev_debug & flags)) \ printk(KERN_DEBUG pr_fmt("%s: " fmt), \ __func__, ##arg); \ } while (0)