From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76A33C43381 for ; Mon, 18 Feb 2019 20:15:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3C498217F9 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 Content-Transfer-Encoding: 8bit Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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) -- 2.20.1