Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp637905pxb; Wed, 15 Sep 2021 09:41:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyv2Ye7iN4AfCHiJJowsBWdRMwYoXaxmzZK/SduMM9JBI7QTu2Qt/HE851TorflWkbllr/o X-Received: by 2002:a02:90d0:: with SMTP id c16mr805482jag.106.1631724108153; Wed, 15 Sep 2021 09:41:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631724108; cv=none; d=google.com; s=arc-20160816; b=BWIZAPiSQD0L3SVi9NmwBaRQyv2m1Y/P9bbwPMBpd+eyNUrS/w7aONmhec0uTAG3Zn JPnDmclvwaW6Xv+tG3EK2tNKJIbRtG4HhIMy9FbwI9IegGYnyotnAKekSV0ov9mLQKdj XlQSV4zXzJdxbmqwwnFYSEk9o1IzHBOndbyhtIcR/hvzJMPiif1lzl2tdbM5ZKoZVFD5 VVEhVI+xkqUHZrKoGVCf8d3IVrIvE6iEpo9h5O3z7qpgcz8fiUKwB+2RVG9bSPnpTNhZ 1h0sWYlNhKbqg/6Di0ejzV1WJTqP7WQcfXwCvhLkVAHgIndlWCU8cWC9l+pRxQjRmJ+L hKAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CrEmSurYEG7f2fqsoHnKcSPyJETCI17u84wNRbn86Yg=; b=oxkQWLU/XA7dKCMvECs2oT/+Uq/8LGYiARnfehZk5de/C63KzagrmiC0UtqejTxeNT lG/rRJAdTPptHfJrhuz+iLwU0og8Ws+z+lB/TasarOrI8r4zAiSd2vdu4tqF9gesPk26 b+8NdVC2IQKDfzfE+wLKY/Pk86wJ/CE1pQluiKFqtzt/H4KYOrE4U+A/Ay33/grTF5Vt g03PPmiFnIqdFDVbb/2Be1e7iJpjV0ziHSpj9tWVogyS8Q+qgh3hDIldNynlgoPbAfnz Vq3t61+ZtcPf1QrOFpzfmkVMvb/xAnYZR25MtEv21UfZeSIqi7sDBKqacQVTgyhZt6el Tavw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=X58plaV+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si399535iow.65.2021.09.15.09.41.35; Wed, 15 Sep 2021 09:41:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=X58plaV+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230173AbhIOQl5 (ORCPT + 99 others); Wed, 15 Sep 2021 12:41:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229991AbhIOQlv (ORCPT ); Wed, 15 Sep 2021 12:41:51 -0400 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 416FAC061764 for ; Wed, 15 Sep 2021 09:40:32 -0700 (PDT) Received: by mail-io1-xd29.google.com with SMTP id q3so4260474iot.3 for ; Wed, 15 Sep 2021 09:40:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CrEmSurYEG7f2fqsoHnKcSPyJETCI17u84wNRbn86Yg=; b=X58plaV+u4i/AQz3qqsdYb14mgslFnAIILm1w5lAP8p1OGsJF8M6YGcSU0dO3pux55 uoGxlflDORPt6UwQnnlN/60M5q1AO7ABstRwLU0QgK9qI2puvTmbdAmOB9pLdgfLu0O0 KlfAAmHpo1IoxFA5vHfyEchjpJAuutRPieevl8pSAV0QI9CjmJKx0Nw6/bl0iH4AhPrP OCG1JCQdyFen2XC5EWYZCErMkMtBu57A9ddhIrOyAfmjrEgJo6tN+cEDN11KsAWuQZoy kJhPeXEAqDA82qyePTQcL6Qk674DSOy7mf8wDT6lWhXqp+jRwx3kK+7ZdEyNgmSjmi1C dlwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CrEmSurYEG7f2fqsoHnKcSPyJETCI17u84wNRbn86Yg=; b=3Z+XMIIpUUYJjvQgzIjyNEUVP7muJdFrjbbz44rYoZ9iMzotBBtnlFbeeCfrvfuTlu xNOgDKlJx8tVF3rAMa3BKX9oJvI/jR2+rXmmuWZ66MxH6cn6UTc+npdcAnJqrjXty5OH y1eno04VFmXkNQrCRQiKJRycYgcbnd2Ny2jzh18ig480xmg3Nrv+KO0pUMZ7cAYxM5Af yRawSxUCvEZvifbiICO36CSTE1zy91jZ9Ki98E+1ySL9k58ijFHGYhZnKW/Le9GIHRYX 2Tx9jKcKw1Oy8EebtpOsIC3H/ayBClToJ0ZY1BaIpww5LivaTCdGNsTXWdD72ZBNYJs4 256g== X-Gm-Message-State: AOAM532SSvhjc1ZwUvn7MIei8kbPE+suKXvrCn6w3TQuMa7Ys33iTdxW xp6YRAh8BWjLH3Jh97h+eMg= X-Received: by 2002:a02:95ee:: with SMTP id b101mr774496jai.96.1631724031649; Wed, 15 Sep 2021 09:40:31 -0700 (PDT) Received: from frodo.. (c-24-9-77-57.hsd1.co.comcast.net. [24.9.77.57]) by smtp.googlemail.com with ESMTPSA id a5sm299540ilf.27.2021.09.15.09.40.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Sep 2021 09:40:31 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel@ffwll.ch Cc: Jim Cromie Subject: [PATCH v8 03/16] dyndbg: rationalize verbosity Date: Wed, 15 Sep 2021 10:39:44 -0600 Message-Id: <20210915163957.2949166-4-jim.cromie@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210915163957.2949166-1-jim.cromie@gmail.com> References: <20210915163957.2949166-1-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org change current v*pr_info() calls to fit this new scheme: -1 module add/remove, callsite counts - a few v2s here now -2 command ingest, splitting -3 command parsing - many v1s here now -4 per-site changes - was v2 2 is new, to isolate a problem where a stress-test script (which feeds large multi-command strings) would produce short writes, truncating last command and confusing test results. 4 gets per-callsite "changed:" pr-infos, which are very noisy during stress tests, and obscure v1-3 messages. Update docs verbose example to 3 per its comment Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 2 +- lib/dynamic_debug.c | 22 ++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst index b119b8277b3e..ab28d200f016 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -358,7 +358,7 @@ Examples // boot-args example, with newlines and comments for readability Kernel command line: ... // see whats going on in dyndbg=value processing - dynamic_debug.verbose=1 + dynamic_debug.verbose=3 // enable pr_debugs in 2 builtins, #cmt is stripped dyndbg="module params +p #cmt ; module sys +p" // enable pr_debugs in 2 functions in a module loaded later diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index da91ff507117..fd5aca157aec 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -118,6 +118,8 @@ do { \ #define vpr_info(fmt, ...) vnpr_info(1, fmt, ##__VA_ARGS__) #define v2pr_info(fmt, ...) vnpr_info(2, fmt, ##__VA_ARGS__) +#define v3pr_info(fmt, ...) vnpr_info(3, fmt, ##__VA_ARGS__) +#define v4pr_info(fmt, ...) vnpr_info(4, fmt, ##__VA_ARGS__) static void vpr_info_dq(const struct ddebug_query *query, const char *msg) { @@ -130,7 +132,7 @@ static void vpr_info_dq(const struct ddebug_query *query, const char *msg) fmtlen--; } - vpr_info("%s: func=\"%s\" file=\"%s\" module=\"%s\" format=\"%.*s\" lineno=%u-%u\n", + v3pr_info("%s: func=\"%s\" file=\"%s\" module=\"%s\" format=\"%.*s\" lineno=%u-%u\n", msg, query->function ?: "", query->filename ?: "", @@ -213,7 +215,7 @@ static int ddebug_change(const struct ddebug_query *query, static_branch_enable(&dp->key.dd_key_true); #endif dp->flags = newflags; - v2pr_info("changed %s:%d [%s]%s =%s\n", + v4pr_info("changed %s:%d [%s]%s =%s\n", trim_prefix(dp->filename), dp->lineno, dt->mod_name, dp->function, ddebug_describe_flags(dp->flags, &fbuf)); @@ -273,7 +275,7 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords) buf = end; } - if (verbose) { + if (verbose >= 3) { int i; pr_info("split into words:"); for (i = 0; i < nwords; i++) @@ -333,7 +335,7 @@ static int parse_linerange(struct ddebug_query *query, const char *first) } else { query->last_lineno = query->first_lineno; } - vpr_info("parsed line %d-%d\n", query->first_lineno, + v3pr_info("parsed line %d-%d\n", query->first_lineno, query->last_lineno); return 0; } @@ -447,7 +449,7 @@ static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers) pr_err("bad flag-op %c, at start of %s\n", *str, str); return -EINVAL; } - vpr_info("op='%c'\n", op); + v3pr_info("op='%c'\n", op); for (; *str ; ++str) { for (i = ARRAY_SIZE(opt_array) - 1; i >= 0; i--) { @@ -461,7 +463,7 @@ static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers) return -EINVAL; } } - vpr_info("flags=0x%x\n", modifiers->flags); + v3pr_info("flags=0x%x\n", modifiers->flags); /* calculate final flags, mask based upon op */ switch (op) { @@ -477,7 +479,7 @@ static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers) modifiers->flags = 0; break; } - vpr_info("*flagsp=0x%x *maskp=0x%x\n", modifiers->flags, modifiers->mask); + v3pr_info("*flagsp=0x%x *maskp=0x%x\n", modifiers->flags, modifiers->mask); return 0; } @@ -540,7 +542,7 @@ static int ddebug_exec_queries(char *query, const char *modname) } i++; } - vpr_info("processed %d queries, with %d matches, %d errs\n", + v2pr_info("processed %d queries, with %d matches, %d errs\n", i, nfound, errs); if (exitcode) @@ -781,7 +783,7 @@ static ssize_t ddebug_proc_write(struct file *file, const char __user *ubuf, tmpbuf = memdup_user_nul(ubuf, len); if (IS_ERR(tmpbuf)) return PTR_ERR(tmpbuf); - vpr_info("read %d bytes from userspace\n", (int)len); + v2pr_info("read %u bytes from userspace <\n%s>\n", (unsigned)len, tmpbuf); ret = ddebug_exec_queries(tmpbuf, NULL); kfree(tmpbuf); @@ -969,7 +971,7 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n, list_add(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); - v2pr_info("%3u debug prints in module %s\n", n, dt->mod_name); + vpr_info("%3u debug prints in module %s\n", n, dt->mod_name); return 0; } -- 2.31.1