From patchwork Wed Apr 28 07:46:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tzvetomir Stoyanov (VMware)" X-Patchwork-Id: 12228269 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 49FDBC433B4 for ; Wed, 28 Apr 2021 07:46:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1446961407 for ; Wed, 28 Apr 2021 07:46:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229643AbhD1HrW (ORCPT ); Wed, 28 Apr 2021 03:47:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236448AbhD1HrV (ORCPT ); Wed, 28 Apr 2021 03:47:21 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C281C06138A for ; Wed, 28 Apr 2021 00:46:34 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id q6so13740247edr.3 for ; Wed, 28 Apr 2021 00:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MA7bV11KcfWFc08/JTkIxuPxVWjkBol++WE3NtkDah4=; b=T/Kr0vHCgHVlXWcWgloLbkop34LRdlZBbZ2sYyjJ78GQMmAvU1f6ThtbggEXc7K2JQ nau9sCdzG73YzMd0mlnDAT8yOzQ6Sxz2dWIDqxXjfgXNeu15mrAXnYH/1pgAd+zf38Ss b9XxGvG0K2bV2rW4xzbHq7I6aj60xMEBFea79nl6ZsmFBn0+HClf6YZvFc0JTPGt4Qdw NNfpNCOVGIjjkWd8Zw3Baqy+2GnCkS2iVih2lMK3C3Hy689yJm/KB8e+PJ9mqsLfbUcw NZHzM5fMDAVti46SaWMadojcL8Rh3uqUMijhZ8LgWc0JTktHbMDHpTUIpw4guE/up1HV /J2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MA7bV11KcfWFc08/JTkIxuPxVWjkBol++WE3NtkDah4=; b=h10G9ubSMA5k3HqzKunEzghXLD+T+ZJ7isaNbuCKa7ayZTXfXF1l0b3h5qtZTMwSYg ENxjnc6LsQ7yrwfPKqPEyF+StERs4nQhhrnpGrFKn+ImfbTlYq1QoJT8Yatkl3pxidm+ 83zxdZH0yAyQ13ms0y1UthYKYvZWCwd0rDYVZ52OsjwspDyFXZYxyWJU31RQL9Yqwnfr UvQ3eSXTxM7jBd8AKwz3e2Np/qPR42JlFWYEC4UKoDxvESD1Wy+ihFN/qQka4cqrLtos fUMPtvIZcH8HgaFgrjSu4Ord03NIDLChZ4VsZsgVMRjMDyZRSXGLtzh4hWEWtVo0uDsD qglg== X-Gm-Message-State: AOAM533JYlzQ7wrrr7VmxsiiN0chaqujjuZPq8uEEcQrB3078DpJbcha duxNZ714bb/fxaWEqdl0Qi3NifYk+nOnRQ== X-Google-Smtp-Source: ABdhPJwNho55WFdKm0GwPcxM09+jtDQtw6LAtQtTrJx1sxYOuUuS1PVjspmqb5ogV5Pu270MkGisuQ== X-Received: by 2002:a05:6402:4388:: with SMTP id o8mr9184888edc.262.1619595993381; Wed, 28 Apr 2021 00:46:33 -0700 (PDT) Received: from oberon.zico.biz ([83.222.187.186]) by smtp.gmail.com with ESMTPSA id lc1sm1412556ejb.39.2021.04.28.00.46.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 00:46:32 -0700 (PDT) From: "Tzvetomir Stoyanov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 1/7] trace-cmd report: Add --verbose Date: Wed, 28 Apr 2021 10:46:24 +0300 Message-Id: <20210428074630.757694-2-tz.stoyanov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210428074630.757694-1-tz.stoyanov@gmail.com> References: <20210428074630.757694-1-tz.stoyanov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org Add new "trace-cmd report --verbose" argument for setting the desired log level. Signed-off-by: Tzvetomir Stoyanov (VMware) --- Documentation/trace-cmd/trace-cmd-report.1.txt | 9 +++++++++ tracecmd/trace-read.c | 6 ++++++ tracecmd/trace-usage.c | 1 + 3 files changed, 16 insertions(+) diff --git a/Documentation/trace-cmd/trace-cmd-report.1.txt b/Documentation/trace-cmd/trace-cmd-report.1.txt index 72b47065..e444e8c0 100644 --- a/Documentation/trace-cmd/trace-cmd-report.1.txt +++ b/Documentation/trace-cmd/trace-cmd-report.1.txt @@ -312,6 +312,15 @@ OPTIONS *--raw-ts*:: Display raw timestamps, without any corrections. +*--verbose* 'level':: + Set the log level. Supported log levels are "none", "critical", "error", "warning", + "info", "debug", "all" or their identifiers "0", "1", "2", "3", "4", "5", "6". Setting the log + level to specific value enables all logs from that and all previous levels. + + Example: enable all critical, error and warning logs + + trace-cmd report --verbose warning + EXAMPLES -------- diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c index aad57dae..146fdb3c 100644 --- a/tracecmd/trace-read.c +++ b/tracecmd/trace-read.c @@ -1485,6 +1485,7 @@ static void add_hook(const char *arg) } enum { + OPT_verbose = 235, OPT_raw_ts = 236, OPT_version = 237, OPT_tscheck = 238, @@ -1578,6 +1579,7 @@ void trace_report (int argc, char **argv) {"ts-diff", no_argument, NULL, OPT_tsdiff}, {"ts-check", no_argument, NULL, OPT_tscheck}, {"raw-ts", no_argument, NULL, OPT_raw_ts}, + {"verbose", required_argument, NULL, OPT_verbose}, {"help", no_argument, NULL, '?'}, {NULL, 0, NULL, 0} }; @@ -1755,6 +1757,10 @@ void trace_report (int argc, char **argv) case OPT_raw_ts: raw_ts = 1; break; + case OPT_verbose: + if (trace_set_verbose(optarg) < 0) + die("invalid verbose level %s", optarg); + break; default: usage(argv); } diff --git a/tracecmd/trace-usage.c b/tracecmd/trace-usage.c index 98247074..edc43ba9 100644 --- a/tracecmd/trace-usage.c +++ b/tracecmd/trace-usage.c @@ -234,6 +234,7 @@ static struct usage_help usage_help[] = { " --ts-diff Show the delta timestamp between events.\n" " --ts-check Check to make sure no time stamp on any CPU goes backwards.\n" " --raw-ts Display raw timestamps, without any corrections.\n" + " --verbose 'level' Set the desired log level\n" }, { "stream", From patchwork Wed Apr 28 07:46:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tzvetomir Stoyanov (VMware)" X-Patchwork-Id: 12228275 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 73498C43461 for ; Wed, 28 Apr 2021 07:46:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DB3061007 for ; Wed, 28 Apr 2021 07:46:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236448AbhD1HrX (ORCPT ); Wed, 28 Apr 2021 03:47:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236453AbhD1HrV (ORCPT ); Wed, 28 Apr 2021 03:47:21 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 964FBC06138B for ; Wed, 28 Apr 2021 00:46:35 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id u3so14496767eja.12 for ; Wed, 28 Apr 2021 00:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fEY6azDhSHEkA5JF2UCVmiNnDGP7VpSjU9sOlCrATlQ=; b=vYQsVbhSspW9HGfcTkOihdTDbgW/v8BraoVTr4orGqDoBrHGxn1UkqUqKhtJBDp3Oi xfUqfQ06QrsrE/ZRa3I7afQfGtPJ9GHVYTkgSQ4/9EzvORI+Vmey/RGWTK6CnyNTe5De e50i7PbIaNI75Qb75giQn8GhAMgnbdKxBfJO/B+5KaTxybzpEe8p7DxkJY1ZmINjejRw lxFC7i369rijDOqsQS7w2uokNguo4uiNKeW9GGeermdUj7PQTXjP6TA4GTLaemLRYtxm o636xe24O2hQFvbHKLhgjig6x60FA8YDLHyi9fJCi5GHTNDTOqg5/FE3y3eYVz9ENBG3 km4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fEY6azDhSHEkA5JF2UCVmiNnDGP7VpSjU9sOlCrATlQ=; b=TGW0gDEr0DBBsssqZx7jUIrKz5IW62fEeZ2Jli83sbyDYgKnLOWKNOX7o+ZwdOLBcj 7xpja6dfrC7GuA1/bB9FdCUNMotnJc6ASjV5FfSL2NKXtf1VtdVFLi4nupwmlskVTXyT /QJEg2zC/5QoJsh1Q3PfGLK7uNEYDlHgmYlIIX9V4NUCZKjzU3cm+YOmLsMW3uungD3w sWNI5uJ1fy7dfIYMeRWY7167aJjtuMGuCoJhR+c1+rnGxNekqO/o8tdfqcssdVmI8nXZ E6qbdrIDbn9JAABXCV4F7wsTOzbk+NJukx0Yh2eqmzANfx2Te7ZG2f5GkMN4bsj75nY5 YDiQ== X-Gm-Message-State: AOAM532zKeEhGOejYTBXVo7kn9S3Ptf9pI6VRmlP299l4t693zQVB8DF E5Fg7syiZxce+r3cCdoTOthSLUSr4sTAUA== X-Google-Smtp-Source: ABdhPJyqBrmxOb6al3OIu9CeF/91HzaaiAbhiO0jiSGR2gmmhbKuiZr07ChLJoKpkpxuyguP9Yjw1A== X-Received: by 2002:a17:906:4d02:: with SMTP id r2mr15764455eju.464.1619595994428; Wed, 28 Apr 2021 00:46:34 -0700 (PDT) Received: from oberon.zico.biz ([83.222.187.186]) by smtp.gmail.com with ESMTPSA id lc1sm1412556ejb.39.2021.04.28.00.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 00:46:33 -0700 (PDT) From: "Tzvetomir Stoyanov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 2/7] trace-cmd agent: Add --verbose Date: Wed, 28 Apr 2021 10:46:25 +0300 Message-Id: <20210428074630.757694-3-tz.stoyanov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210428074630.757694-1-tz.stoyanov@gmail.com> References: <20210428074630.757694-1-tz.stoyanov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org Add new "trace-cmd agent --verbose" argument for setting the desired log level. Signed-off-by: Tzvetomir Stoyanov (VMware) --- tracecmd/trace-agent.c | 6 ++++++ tracecmd/trace-usage.c | 1 + 2 files changed, 7 insertions(+) diff --git a/tracecmd/trace-agent.c b/tracecmd/trace-agent.c index 1f7d9461..0dc339b4 100644 --- a/tracecmd/trace-agent.c +++ b/tracecmd/trace-agent.c @@ -281,6 +281,7 @@ busy: } enum { + OPT_verbose = 254, DO_DEBUG = 255 }; @@ -301,6 +302,7 @@ void trace_agent(int argc, char **argv) {"port", required_argument, NULL, 'p'}, {"help", no_argument, NULL, '?'}, {"debug", no_argument, NULL, DO_DEBUG}, + {"verbose", required_argument, NULL, OPT_verbose}, {NULL, 0, NULL, 0} }; @@ -321,6 +323,10 @@ void trace_agent(int argc, char **argv) case DO_DEBUG: tracecmd_set_debug(true); break; + case OPT_verbose: + if (trace_set_verbose(optarg) < 0) + die("invalid verbose level %s", optarg); + break; default: usage(argv); } diff --git a/tracecmd/trace-usage.c b/tracecmd/trace-usage.c index edc43ba9..7019ab97 100644 --- a/tracecmd/trace-usage.c +++ b/tracecmd/trace-usage.c @@ -303,6 +303,7 @@ static struct usage_help usage_help[] = { " Creates a vsocket to listen for clients.\n" " -p port number to listen on.\n" " -D run in daemon mode.\n" + " --verbose 'level' Set the desired log level\n" }, { "setup-guest", From patchwork Wed Apr 28 07:46:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tzvetomir Stoyanov (VMware)" X-Patchwork-Id: 12228273 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 938EEC43460 for ; Wed, 28 Apr 2021 07:46:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5DE5E606A5 for ; Wed, 28 Apr 2021 07:46:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236453AbhD1HrX (ORCPT ); Wed, 28 Apr 2021 03:47:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236805AbhD1HrV (ORCPT ); Wed, 28 Apr 2021 03:47:21 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A104AC06138C for ; Wed, 28 Apr 2021 00:46:36 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id t4so9892023ejo.0 for ; Wed, 28 Apr 2021 00:46:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7G682/KnhlYStPg0ZV0KAKS4OzGXjPQxgHk3OUPpD48=; b=TKBT79w/tjqn/ZAwBkFQTnnEvS68tYmrkyM6T9ytN8+nRU3As3Y8Rd4KFP56xcgLzq D/YIKX6w5w2Xw1AnShuZh6sDaLHolVy7q8AP48PTQ1vknCZw7O9U/zjBN2IdEOM99eyc VqKDBOLeqMnI0shYNb4YNUmSYUTMANWiQnYR1b/wI1OLkMAt5zicgY4LszowAHoGxMcF i3/ivvwhb597RYD8o/Fi36Am1H3cHWOEIUMs5YOWP9A2m9m6Zdh2uYWK2MwuZWokJg88 WhgoYFP5u2pDcvPWhHNmB51kaKiUcZvQ34GOH3DtXdds//HyLFkl3etX1nFu7nGQRw/v Hvtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7G682/KnhlYStPg0ZV0KAKS4OzGXjPQxgHk3OUPpD48=; b=fwUhg9+Aw9JmIXo0NiWmKwxzIg+U+FKNLUIfg6K4r3QXmMUyj1MdseSyKxblmLgwYK xm8Dsq4wow9aeZkW2LJJDZwNA3H6iFglCF9H8yAxkAjqpqgFifVfQ1a9Q4GqsdgAJCAP u+gfd6Lj6nMkZLb4vBjPkIm1oNozbo+iMSWlhmEyxVqxz2+4IFiPYrZXZJ5VQSHF9zDQ O30rG2UdyO3fKWkTtAFL2y9fGWEGyMMMcJ2QVk5ASSqn0nkBF2fLy75s9xmAa8XeaFAa gN6gST+7UKk8/n5p7x1ardS/NMM1DES0ouqD1FsvO6Dh2qtjo/uF+BwmstVj0VHnlA6I Ldzw== X-Gm-Message-State: AOAM530xI7d0ho5IDyXGaQiSWEzClY1bChcavsC/1dGI6Ag2ch0n/+xD t58+pbHZxScblrN7Gof75Ds= X-Google-Smtp-Source: ABdhPJw9cVFj2NgSII3G8dpONpsBychxnzvJODpicYxTK3BH3A0TU/tmwIOuF7pUd81gEFzgW+oljw== X-Received: by 2002:a17:906:2287:: with SMTP id p7mr20521931eja.377.1619595995395; Wed, 28 Apr 2021 00:46:35 -0700 (PDT) Received: from oberon.zico.biz ([83.222.187.186]) by smtp.gmail.com with ESMTPSA id lc1sm1412556ejb.39.2021.04.28.00.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 00:46:34 -0700 (PDT) From: "Tzvetomir Stoyanov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 3/7] trace-cmd check-events: Add --verbose Date: Wed, 28 Apr 2021 10:46:26 +0300 Message-Id: <20210428074630.757694-4-tz.stoyanov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210428074630.757694-1-tz.stoyanov@gmail.com> References: <20210428074630.757694-1-tz.stoyanov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org Add new "trace-cmd check-events --verbose" argument for setting the desired log level. Signed-off-by: Tzvetomir Stoyanov (VMware) --- .../trace-cmd/trace-cmd-check-events.1.txt | 9 +++++++++ tracecmd/trace-check-events.c | 16 +++++++++++++++- tracecmd/trace-usage.c | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Documentation/trace-cmd/trace-cmd-check-events.1.txt b/Documentation/trace-cmd/trace-cmd-check-events.1.txt index c98ff3c6..40c3c8cd 100644 --- a/Documentation/trace-cmd/trace-cmd-check-events.1.txt +++ b/Documentation/trace-cmd/trace-cmd-check-events.1.txt @@ -24,6 +24,15 @@ OPTIONS ------- *-N* - Don't load plugins +*--verbose* 'level':: + Set the log level. Supported log levels are "none", "critical", "error", "warning", + "info", "debug", "all" or their identifiers "0", "1", "2", "3", "4", "5", "6". Setting the log + level to specific value enables all logs from that and all previous levels. + + Example: enable all critical, error and warning logs + + trace-cmd check-events --verbose warning + SEE ALSO -------- trace-cmd(1), trace-cmd-record(1), trace-cmd-report(1), trace-cmd-stop(1), diff --git a/tracecmd/trace-check-events.c b/tracecmd/trace-check-events.c index bd19feca..cf34912a 100644 --- a/tracecmd/trace-check-events.c +++ b/tracecmd/trace-check-events.c @@ -10,6 +10,10 @@ #include "tracefs.h" #include "trace-local.h" +enum { + OPT_verbose = 255, +}; + void trace_check_events(int argc, char **argv) { const char *tracing; @@ -18,8 +22,14 @@ void trace_check_events(int argc, char **argv) struct tep_handle *pevent = NULL; struct tep_plugin_list *list = NULL; int open_flags = 0; + int option_index = 0; + static struct option long_options[] = { + {"verbose", required_argument, NULL, OPT_verbose}, + {NULL, 0, NULL, 0} + }; + - while ((c = getopt(argc-1, argv+1, "+hN")) >= 0) { + while ((c = getopt_long(argc-1, argv+1, "+hN", long_options, &option_index)) >= 0) { switch (c) { case 'h': default: @@ -28,6 +38,10 @@ void trace_check_events(int argc, char **argv) case 'N': open_flags |= TRACECMD_FL_LOAD_NO_PLUGINS; break; + case OPT_verbose: + if (trace_set_verbose(optarg) < 0) + die("invalid verbose level %s", optarg); + break; } } tracing = tracefs_tracing_dir(); diff --git a/tracecmd/trace-usage.c b/tracecmd/trace-usage.c index 7019ab97..cacec3c5 100644 --- a/tracecmd/trace-usage.c +++ b/tracecmd/trace-usage.c @@ -363,6 +363,7 @@ static struct usage_help usage_help[] = { "parse trace event formats", " %s check-events [-N]\n" " -N do not load any plugins\n" + " --verbose 'level' Set the desired log level\n" }, { "dump", From patchwork Wed Apr 28 07:46:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tzvetomir Stoyanov (VMware)" X-Patchwork-Id: 12228277 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 8ADB6C43470 for ; Wed, 28 Apr 2021 07:46:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4BD8061007 for ; Wed, 28 Apr 2021 07:46:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236888AbhD1HrY (ORCPT ); Wed, 28 Apr 2021 03:47:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236805AbhD1HrX (ORCPT ); Wed, 28 Apr 2021 03:47:23 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84B0AC06138D for ; Wed, 28 Apr 2021 00:46:37 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id ja3so17290481ejc.9 for ; Wed, 28 Apr 2021 00:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gnDxFLUXv2fAb0N6Uy5BwAoWTKwHWyzzxSG6P10op0g=; b=t/qw2VX9ixjYe2f4yo0RxHtZ4347gpFFGJ4mrKAgiYvlldOiuA3M6Qf3CnAjubw0Yp izF4CGoDvewfvk6BGBfeN04ltdcwMMk9+K9ENkl/rdVK+B7mWHAyVEL1WgPPmH1+mUzd l79q7h+WTPQaKJ3URCkdqmCtUfVTrgmldLKEPqc7YAZu95n1K8KPcPX96JpIGRURz3dN zkQ2NBvvcCARt7cVtv9E3vA/DcrRiHVtEGq0eB02BIJzB6/lLA15Y+mKCWTuZ7KwsA1i dYMA6bRiFR4lnmBO0sTUuFBzxVcy/qEugO0UBJCwu5QPTRbWikL298ORMAtzMjE68oIh Xs9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gnDxFLUXv2fAb0N6Uy5BwAoWTKwHWyzzxSG6P10op0g=; b=kRTxvXtPdcO7QwAFUkxBs3TQ+7cxBO/8Crv8lhoBM8A62tj7kjl7OzkI4ZmSJg4h9T x42U1U6XTj6UZnmED5nT9Q6kL7tvKS+DZn6IRVMgp/RN1YHyn2lapQyzmrJ/heecnnvI 3pdF+LlI24dTJYESXJ+V4QDHa6xOSZw+nsJvkcHCgypdf3SgTmUPJO3VD8wb8qgm7rBW Kxy6CrH1C+8yNz5a/pupUebUjlLT34yAK+OZdkxOIcIzt4C2ThOwxZejn012YaLBQ8UV BoOLhITPCNjgEgWPtvvk1TUWbKi7/AF4ppjfHUC7dx6vyghoKNLqHWWpPk8Jd5xl1nQN vXNA== X-Gm-Message-State: AOAM532PuME9jsWIX+bpFOGpQV883C0dM9w9t3gwjDW21MNXGJ24DCCU tvHTm0Gw68FuML9tkPgVvP4= X-Google-Smtp-Source: ABdhPJwFu6hzbSzCOfCqNAbDs/ZpJtID8wVbH4M8H8uhy8KoBjjkw5fgZN0ZiXTFfketxv0yrEHptA== X-Received: by 2002:a17:906:4e93:: with SMTP id v19mr27127476eju.215.1619595996312; Wed, 28 Apr 2021 00:46:36 -0700 (PDT) Received: from oberon.zico.biz ([83.222.187.186]) by smtp.gmail.com with ESMTPSA id lc1sm1412556ejb.39.2021.04.28.00.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 00:46:35 -0700 (PDT) From: "Tzvetomir Stoyanov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 4/7] trace-cmd: Add --verbose to bunch of trace-cmd commands Date: Wed, 28 Apr 2021 10:46:27 +0300 Message-Id: <20210428074630.757694-5-tz.stoyanov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210428074630.757694-1-tz.stoyanov@gmail.com> References: <20210428074630.757694-1-tz.stoyanov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org Add new "--verbose" argument for setting the desired log level to these trace-cmd commands: start set extract stream profile record Signed-off-by: Tzvetomir Stoyanov (VMware) --- Documentation/trace-cmd/trace-cmd-extract.1.txt | 8 ++++++++ Documentation/trace-cmd/trace-cmd-profile.1.txt | 9 +++++++++ Documentation/trace-cmd/trace-cmd-record.1.txt | 9 +++++++++ Documentation/trace-cmd/trace-cmd-set.1.txt | 9 +++++++++ tracecmd/trace-record.c | 6 ++++++ tracecmd/trace-usage.c | 6 ++++++ 6 files changed, 47 insertions(+) diff --git a/Documentation/trace-cmd/trace-cmd-extract.1.txt b/Documentation/trace-cmd/trace-cmd-extract.1.txt index 4444733d..88749da7 100644 --- a/Documentation/trace-cmd/trace-cmd-extract.1.txt +++ b/Documentation/trace-cmd/trace-cmd-extract.1.txt @@ -67,6 +67,14 @@ OPTIONS this is the same as the default. But if *-B* or *-a* is used, this is required if the top level instance buffer should also be extracted. +*--verbose* 'level':: + Set the log level. Supported log levels are "none", "critical", "error", "warning", + "info", "debug", "all" or their identifiers "0", "1", "2", "3", "4", "5", "6". Setting the log + level to specific value enables all logs from that and all previous levels. + + Example: enable all critical, error and warning logs + + trace-cmd extract --verbose warning SEE ALSO -------- diff --git a/Documentation/trace-cmd/trace-cmd-profile.1.txt b/Documentation/trace-cmd/trace-cmd-profile.1.txt index 0d1dd8e8..0d285ff7 100644 --- a/Documentation/trace-cmd/trace-cmd-profile.1.txt +++ b/Documentation/trace-cmd/trace-cmd-profile.1.txt @@ -90,6 +90,15 @@ These are the same as trace-cmd-record(1) with the *--profile* option. is not changed. This allows watching the command execute and saving the output of the profile to another file. +*--verbose* 'level':: + Set the log level. Supported log levels are "none", "critical", "error", "warning", + "info", "debug", "all" or their identifiers "0", "1", "2", "3", "4", "5", "6". Setting the log + level to specific value enables all logs from that and all previous levels. + + Example: enable all critical, error and warning logs + + trace-cmd profile --verbose warning + EXAMPLES -------- diff --git a/Documentation/trace-cmd/trace-cmd-record.1.txt b/Documentation/trace-cmd/trace-cmd-record.1.txt index 55a8891b..4c4432de 100644 --- a/Documentation/trace-cmd/trace-cmd-record.1.txt +++ b/Documentation/trace-cmd/trace-cmd-record.1.txt @@ -360,6 +360,15 @@ OPTIONS executed will not be changed. This is useful if you want to monitor the output of the command being executed, but not see the output from trace-cmd. +*--verbose* 'level':: + Set the log level. Supported log levels are "none", "critical", "error", "warning", + "info", "debug", "all" or their identifiers "0", "1", "2", "3", "4", "5", "6". Setting the log + level to specific value enables all logs from that and all previous levels. + + Example: enable all critical, error and warning logs + + trace-cmd record --verbose warning + EXAMPLES -------- diff --git a/Documentation/trace-cmd/trace-cmd-set.1.txt b/Documentation/trace-cmd/trace-cmd-set.1.txt index 931d3abd..50af7677 100644 --- a/Documentation/trace-cmd/trace-cmd-set.1.txt +++ b/Documentation/trace-cmd/trace-cmd-set.1.txt @@ -227,6 +227,15 @@ OPTIONS unless the *--fork* option is specified. Then it will fork the command and return immediately. +*--verbose* 'level':: + Set the log level. Supported log levels are "none", "critical", "error", "warning", + "info", "debug", "all" or their identifiers "0", "1", "2", "3", "4", "5", "6". Setting the log + level to specific value enables all logs from that and all previous levels. + + Example: enable all critical, error and warning logs + + trace-cmd set --verbose warning + EXAMPLES -------- diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c index 8805b10e..5b1c0d19 100644 --- a/tracecmd/trace-record.c +++ b/tracecmd/trace-record.c @@ -5515,6 +5515,7 @@ void init_top_instance(void) } enum { + OPT_verbose = 239, OPT_tsc2nsec = 240, OPT_fork = 241, OPT_tsyncinterval = 242, @@ -5949,6 +5950,7 @@ static void parse_record_options(int argc, {"tsync-interval", required_argument, NULL, OPT_tsyncinterval}, {"fork", no_argument, NULL, OPT_fork}, {"tsc2nsec", no_argument, NULL, OPT_tsc2nsec}, + {"verbose", required_argument, NULL, OPT_verbose}, {NULL, 0, NULL, 0} }; @@ -6374,6 +6376,10 @@ static void parse_record_options(int argc, case 'q': quiet = true; break; + case OPT_verbose: + if (trace_set_verbose(optarg) < 0) + die("invalid verbose level %s", optarg); + break; default: usage(argv); } diff --git a/tracecmd/trace-usage.c b/tracecmd/trace-usage.c index cacec3c5..10f06467 100644 --- a/tracecmd/trace-usage.c +++ b/tracecmd/trace-usage.c @@ -68,6 +68,7 @@ static struct usage_help usage_help[] = { " If a negative number is specified, timestamps synchronization is disabled" " If 0 is specified, no loop is performed - timestamps offset is calculated only twice," " at the beginnig and at the end of the trace\n" + " --verbose 'level' Set the desired log level\n" }, { "set", @@ -104,6 +105,7 @@ static struct usage_help usage_help[] = { " --cmdlines-size change kernel saved_cmdlines_size\n" " --user execute the specified [command ...] as given user\n" " --fork return immediately if a command is specified\n" + " --verbose 'level' Set the desired log level\n" }, { "start", @@ -113,6 +115,7 @@ static struct usage_help usage_help[] = { " It only enables the tracing and exits\n" "\n" " --fork: If a command is specified, then return right after it forks\n" + " --verbose 'level' Set the desired log level\n" }, { "extract", @@ -123,6 +126,7 @@ static struct usage_help usage_help[] = { " -B : extract a given buffer (more than one may be specified)\n" " -a : extract all buffers (except top one)\n" " -t : extract the top level buffer (useful with -B and -a)\n" + " --verbose 'level' Set the desired log level\n" }, { "stop", @@ -241,6 +245,7 @@ static struct usage_help usage_help[] = { "Start tracing and read the output directly", " %s stream [-e event][-p plugin][-d][-O option ][-P pid]\n" " Uses same options as record but does not write to files or the network.\n" + " --verbose 'level' Set the desired log level\n" }, { "profile", @@ -249,6 +254,7 @@ static struct usage_help usage_help[] = { " [-H [start_system:]start_event,start_match[,pid]/[end_system:]end_event,end_match[,flags]\n\n" " Uses same options as record --profile.\n" " -H Allows users to hook two events together for timings\n" + " --verbose 'level' Set the desired log level\n" }, { "hist", From patchwork Wed Apr 28 07:46:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tzvetomir Stoyanov (VMware)" X-Patchwork-Id: 12228279 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 66E66C433B4 for ; Wed, 28 Apr 2021 07:46:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 35EEE61007 for ; Wed, 28 Apr 2021 07:46:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236805AbhD1HrY (ORCPT ); Wed, 28 Apr 2021 03:47:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236901AbhD1HrY (ORCPT ); Wed, 28 Apr 2021 03:47:24 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 607AAC061574 for ; Wed, 28 Apr 2021 00:46:38 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id mu3so2102193ejc.6 for ; Wed, 28 Apr 2021 00:46:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gCPiQ92MV/40Nnh6Q8ttCVtErMfxn0E8juNOs7GG/SM=; b=o6Sb2+LI0AasmhZM61mPxVgAxcSscRwbs9oHu55h1zjDilw+4waGZDdHP9Z4rAB2h/ fArXH7Mh8sN7y64OGKb5trSXVpykbDw+dVUMKGtOxfaOJG5LK3S4+pcCl3I4ao20NDKy z3kwkAVGGc/nuE8oYpeM+Ylza3/gQzNRgaZqgYvBGuKXGGqw5WmE0ryOKc9zqc0vsJCc yXSnVTb/9bmO5/XRvcomCJD4kEl0bbZo3un9TbQ5ndLtzJw9EzCHLgp9gKj6Dp+a3gAc xN6gytIrIdsCcFYRlOuFOh2uITVvR9UMzMMMAUjcHR8TTdlxh+i1Gwwfrb15TtOsFUSP HCmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gCPiQ92MV/40Nnh6Q8ttCVtErMfxn0E8juNOs7GG/SM=; b=PYW4zqFOlHfLX282YNDOmaIL8MYtBG1XrGAq/v/4e28WfGVC1Y5QoXEQc5m2n2k9or 4IWzHZudowdyk5r2qhH3aJsk76WItwPaz8Be7ZvXusSoMRCQBBqCo4pJQLqpOHZDDpfO uvmbHdlveqYeca/W25lWKtR4PKgHuDn1zGWTQdiTfxpQJQaDE6vijAG/81QVRpzRs3Nh jlheGP/frCqvJ+JDnt73xIJ/WE8Zt1YdGs+vPU4xI/Ry9Z2v64qi0d/zCuJ815j+EzeZ mW9SJjh6gDy9EdSwHGqZruXh/OoJ544+qGSdmNNJSViZG4ClSE96MOSisa9YQ7O6c5hD sR3w== X-Gm-Message-State: AOAM530NEwSNsfQPz0AjBQ8dwExyXv8+/v7jTtibSCuWZM6Cx9QP5aFI rrIfZpVvQ36pg9QkxiBZ/4w= X-Google-Smtp-Source: ABdhPJwMVpKGALIvggHNgwKEuLdWZ7cb9F/+HzV/q6Xh5U+ZRmhW9IObHAgRdcmMDyqaj2FbEDK0gA== X-Received: by 2002:a17:906:4d07:: with SMTP id r7mr19858108eju.224.1619595997094; Wed, 28 Apr 2021 00:46:37 -0700 (PDT) Received: from oberon.zico.biz ([83.222.187.186]) by smtp.gmail.com with ESMTPSA id lc1sm1412556ejb.39.2021.04.28.00.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 00:46:36 -0700 (PDT) From: "Tzvetomir Stoyanov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 5/7] trace-cmd listen: Add --verbose Date: Wed, 28 Apr 2021 10:46:28 +0300 Message-Id: <20210428074630.757694-6-tz.stoyanov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210428074630.757694-1-tz.stoyanov@gmail.com> References: <20210428074630.757694-1-tz.stoyanov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org Add new "trace-cmd listen --verbose" argument for setting the desired log level. Signed-off-by: Tzvetomir Stoyanov (VMware) --- Documentation/trace-cmd/trace-cmd-listen.1.txt | 8 ++++++++ tracecmd/trace-listen.c | 6 ++++++ tracecmd/trace-usage.c | 1 + 3 files changed, 15 insertions(+) diff --git a/Documentation/trace-cmd/trace-cmd-listen.1.txt b/Documentation/trace-cmd/trace-cmd-listen.1.txt index 8697328c..da841867 100644 --- a/Documentation/trace-cmd/trace-cmd-listen.1.txt +++ b/Documentation/trace-cmd/trace-cmd-listen.1.txt @@ -36,6 +36,14 @@ OPTIONS *-l* 'filename':: This option writes the output messages to a log file instead of standard output. +*--verbose* 'level':: + Set the log level. Supported log levels are "none", "critical", "error", "warning", + "info", "debug", "all" or their identifiers "0", "1", "2", "3", "4", "5", "6". Setting the log + level to specific value enables all logs from that and all previous levels. + + Example: enable all critical, error and warning logs + + trace-cmd listen --verbose warning SEE ALSO -------- diff --git a/tracecmd/trace-listen.c b/tracecmd/trace-listen.c index 0ae1c948..a72365a2 100644 --- a/tracecmd/trace-listen.c +++ b/tracecmd/trace-listen.c @@ -916,6 +916,7 @@ static void start_daemon(void) } enum { + OPT_verbose = 254, OPT_debug = 255, }; @@ -938,6 +939,7 @@ void trace_listen(int argc, char **argv) {"port", required_argument, NULL, 'p'}, {"help", no_argument, NULL, '?'}, {"debug", no_argument, NULL, OPT_debug}, + {"verbose", required_argument, NULL, OPT_verbose}, {NULL, 0, NULL, 0} }; @@ -967,6 +969,10 @@ void trace_listen(int argc, char **argv) case OPT_debug: tracecmd_set_debug(true); break; + case OPT_verbose: + if (trace_set_verbose(optarg) < 0) + die("invalid verbose level %s", optarg); + break; default: usage(argv); } diff --git a/tracecmd/trace-usage.c b/tracecmd/trace-usage.c index 10f06467..4c8b1300 100644 --- a/tracecmd/trace-usage.c +++ b/tracecmd/trace-usage.c @@ -300,6 +300,7 @@ static struct usage_help usage_help[] = { " -o file name to use for clients.\n" " -d directory to store client files.\n" " -l logfile to write messages to.\n" + " --verbose 'level' Set the desired log level\n" }, #ifdef VSOCK { From patchwork Wed Apr 28 07:46:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tzvetomir Stoyanov (VMware)" X-Patchwork-Id: 12228283 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 1090FC433ED for ; Wed, 28 Apr 2021 07:46:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D349A61158 for ; Wed, 28 Apr 2021 07:46:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236440AbhD1HrZ (ORCPT ); Wed, 28 Apr 2021 03:47:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236920AbhD1HrZ (ORCPT ); Wed, 28 Apr 2021 03:47:25 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46AABC06138A for ; Wed, 28 Apr 2021 00:46:39 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id t4so9892233ejo.0 for ; Wed, 28 Apr 2021 00:46:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3CXbiQ9ZzrX8z8uXKHyQL3xa4g4CNdcsFHLX92cMwvw=; b=uxnkfSjeJNI84BXFyG3Rk66RPV0fYIMG9vQkPRtnTp3GgPJzhuFSeqXP7tqsPhuioX QDOJvOJ+EUGWyz5oq5SJnhNIYz2w2M00z0rO0f7+mWr58T43a9h6mFZf2JwiuTy90McC hRvP+pJuHUbJ+SFEpsJNcZz4z7a4SdV4n6rGf2wvD/NcA/xOqLWL56W1Ao/rmQKJy1u/ b1Ssz5dl3xB4Us7pPk7jbeeeH7Fxy8gJPEmE9S/HKRK5T6BTiI8VZd6GebSkZ5BXbFq6 kdgguXqTTih4m+O5Y7Uk2bx9O1Mb0eK3OyeUfu0/MZJXRhJ7oWIBzsJC8VRGIeNKuECz +muw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3CXbiQ9ZzrX8z8uXKHyQL3xa4g4CNdcsFHLX92cMwvw=; b=tq+rmISAivSARQpVFf8qkeBleS6TOlqpyeYzkrg3jgmTclleG1mruUadV6o4vS5/lt /HhYZp/qO43WFoDgY3+0tx4Eh49E2Kiw9wFa3XscnX8S2/dj3vqTMEeRGHJ0Oko7PvM/ furjUOBvJnbZxFWKy3OEIKhc9gwatpR763ryrk4tR2wYUVSjY+R3tMJZSX3YsV1gYACt SUhs7042E9o1tfpQm/w4xvYHFoHyM5NUSNlgh8Fs5wuVlheUnPaxw4NDHDxV9E1ajB84 S65Ql2E9uqU4jph8lD+FPIlbpwXg4NmEzKFOVqUaYBZFSDlPubSEmN1aJdRjYJIQaU25 iKxA== X-Gm-Message-State: AOAM531Nl8X+J3ZIQI8sBr1U9ZUHk4SZmyvbq9MFkTlJhZ/PHIZNawtG xXtpYqf8ipVWD5T4RMnA2z4= X-Google-Smtp-Source: ABdhPJzXD79pDsrzebdjCUGwq2AA7hsO5D139TZLmDnzomSgsV/WKYM8U98/i22wz/sI3eQjOhta1w== X-Received: by 2002:a17:907:9720:: with SMTP id jg32mr28226298ejc.10.1619595998095; Wed, 28 Apr 2021 00:46:38 -0700 (PDT) Received: from oberon.zico.biz ([83.222.187.186]) by smtp.gmail.com with ESMTPSA id lc1sm1412556ejb.39.2021.04.28.00.46.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 00:46:37 -0700 (PDT) From: "Tzvetomir Stoyanov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 6/7] trace-cmd stack: Add --verbose Date: Wed, 28 Apr 2021 10:46:29 +0300 Message-Id: <20210428074630.757694-7-tz.stoyanov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210428074630.757694-1-tz.stoyanov@gmail.com> References: <20210428074630.757694-1-tz.stoyanov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org Add new "trace-cmd stack --verbose" argument for setting the desired log level. Signed-off-by: Tzvetomir Stoyanov (VMware) --- Documentation/trace-cmd/trace-cmd-stack.1.txt | 4 ++++ tracecmd/trace-stack.c | 6 ++++++ tracecmd/trace-usage.c | 1 + 3 files changed, 11 insertions(+) diff --git a/Documentation/trace-cmd/trace-cmd-stack.1.txt b/Documentation/trace-cmd/trace-cmd-stack.1.txt index a00c6900..75bd50ba 100644 --- a/Documentation/trace-cmd/trace-cmd-stack.1.txt +++ b/Documentation/trace-cmd/trace-cmd-stack.1.txt @@ -24,6 +24,10 @@ stack found since the start was enabled. Use *--reset* to reset the stack counter to zero. +User *--verbose* 'level' to set the log level. Supported log levels are "none", "critical", "error", +"warning", "info", "debug", "all" or their identifiers "0", "1", "2", "3", "4", "5", "6". Setting +the log level to specific value enables all logs from that and all previous levels. + SEE ALSO -------- trace-cmd(1), trace-cmd-record(1), trace-cmd-report(1), trace-cmd-start(1), diff --git a/tracecmd/trace-stack.c b/tracecmd/trace-stack.c index 5e88b36c..6f57387a 100644 --- a/tracecmd/trace-stack.c +++ b/tracecmd/trace-stack.c @@ -140,6 +140,7 @@ static void read_trace(void) } enum { + OPT_verbose = 252, OPT_reset = 253, OPT_stop = 254, OPT_start = 255, @@ -163,6 +164,7 @@ void trace_stack (int argc, char **argv) {"stop", no_argument, NULL, OPT_stop}, {"reset", no_argument, NULL, OPT_reset}, {"help", no_argument, NULL, '?'}, + {"verbose", required_argument, NULL, OPT_verbose}, {NULL, 0, NULL, 0} }; @@ -184,6 +186,10 @@ void trace_stack (int argc, char **argv) case OPT_reset: trace_type = STACK_RESET; break; + case OPT_verbose: + if (trace_set_verbose(optarg) < 0) + die("invalid verbose level %s", optarg); + break; default: usage(argv); } diff --git a/tracecmd/trace-usage.c b/tracecmd/trace-usage.c index 4c8b1300..8a7e8c7b 100644 --- a/tracecmd/trace-usage.c +++ b/tracecmd/trace-usage.c @@ -364,6 +364,7 @@ static struct usage_help usage_help[] = { " --start enable the stack tracer\n" " --stop disable the stack tracer\n" " --reset reset the maximum stack found\n" + " --verbose 'level' Set the desired log level\n" }, { "check-events", From patchwork Wed Apr 28 07:46:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tzvetomir Stoyanov (VMware)" X-Patchwork-Id: 12228281 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 D7C7EC43462 for ; Wed, 28 Apr 2021 07:46:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A56DF606A5 for ; Wed, 28 Apr 2021 07:46:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236901AbhD1HrZ (ORCPT ); Wed, 28 Apr 2021 03:47:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236440AbhD1HrY (ORCPT ); Wed, 28 Apr 2021 03:47:24 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 292F1C06138B for ; Wed, 28 Apr 2021 00:46:40 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id u21so93208244ejo.13 for ; Wed, 28 Apr 2021 00:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ON467nH9YaGyT/HCn3Gwt4mS83m2bbpS0e5BdPF5TME=; b=BR0T8HN0YHTmPDksve8tG0qOmWlBUWVxF52OeYTC/qOjdeHRzkgEExhFZtzt0n7ntk 2f9DRdNmV5oiPFl2Rxb7RvXnJ0zpd6Juw76FP+7hj9OqLPHyjqQkIW0Ev/xzikkR0DGv ye/WSXZhteiHdL84a+OO3q4JcoG5ql1xAdoQ2TReVFSaFch+IPtG0tFdRDOG4/5VHt11 bcB+MeHN7G6ozW7QJ5iWjdhyGnAHPvoNbMcb7VkD+q0G5SiLlQnHshkctDSy2ZHAieNG twCmKkHtnsPxDSnjWNyUfvmo6xp93abHfT+oPJ7E8zdLRNu0U4jSkCShsm8mvUVYfeXc BQwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ON467nH9YaGyT/HCn3Gwt4mS83m2bbpS0e5BdPF5TME=; b=qSDOOOeFzWCj7vAOvuOu4xJNbnLJlMa8QoD6lvZUIlrfP3OfFS+5kIyTFpq6S1MU9z suSzwt2wNbJJFFQBzfXk619Jtfk02XSZGjC3LR/kMHrHeibKetM9WNWuglNaBhf50ZUa zBSlY1GX0FZA6eu028MMMv3CShuQYvJRPJ5FxvfTDxrYJRYAC7I+yT9FWYO+uvm0usgK duEYOvp3o1YUdcvNpksbxRR3GoMy9cSIHJPbNfoWbP8EAApzwu8rGJoeFyIbZOL946Nc x+J/HxwbHCbVvt7dF7FRjT2cm5xEuFQP6do3jcmh60Z7/+sNeAZn8uPNRA5+n+/wpTmy QULg== X-Gm-Message-State: AOAM530HSkUQY79RRN/ztpukXHuIbnPkIoVLcvLr2eqGLUQy4KDRv6dS /lMCoOl17FxHUh+71rr4tIw= X-Google-Smtp-Source: ABdhPJzEREJXnf1ZhbPkdvRlDWUSZlZSOEgOpXzOWJDGsxDmgXnY1l+TptOIpK+V+icCeug0LuiuLQ== X-Received: by 2002:a17:907:33ce:: with SMTP id zk14mr14503997ejb.372.1619595998966; Wed, 28 Apr 2021 00:46:38 -0700 (PDT) Received: from oberon.zico.biz ([83.222.187.186]) by smtp.gmail.com with ESMTPSA id lc1sm1412556ejb.39.2021.04.28.00.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 00:46:38 -0700 (PDT) From: "Tzvetomir Stoyanov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 7/7] trace-cmd dump: Add --verbose Date: Wed, 28 Apr 2021 10:46:30 +0300 Message-Id: <20210428074630.757694-8-tz.stoyanov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210428074630.757694-1-tz.stoyanov@gmail.com> References: <20210428074630.757694-1-tz.stoyanov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org Add new "trace-cmd dump --verbose" argument for setting the desired log level. Signed-off-by: Tzvetomir Stoyanov (VMware) --- Documentation/trace-cmd/trace-cmd-dump.1.txt | 8 ++++++++ tracecmd/trace-dump.c | 6 ++++++ tracecmd/trace-usage.c | 1 + 3 files changed, 15 insertions(+) diff --git a/Documentation/trace-cmd/trace-cmd-dump.1.txt b/Documentation/trace-cmd/trace-cmd-dump.1.txt index 0f8626fa..b1a3f90d 100644 --- a/Documentation/trace-cmd/trace-cmd-dump.1.txt +++ b/Documentation/trace-cmd/trace-cmd-dump.1.txt @@ -52,6 +52,14 @@ OPTIONS Print all meta data from the file. *--help*:: Print usage information. +*--verbose* 'level':: + Set the log level. Supported log levels are "none", "critical", "error", "warning", + "info", "debug", "all" or their identifiers "0", "1", "2", "3", "4", "5", "6". Setting the log + level to specific value enables all logs from that and all previous levels. + + Example: enable all critical, error and warning logs + + trace-cmd report --verbose warning EXAMPLES -------- diff --git a/tracecmd/trace-dump.c b/tracecmd/trace-dump.c index 3f56f65a..5c5447bc 100644 --- a/tracecmd/trace-dump.c +++ b/tracecmd/trace-dump.c @@ -678,6 +678,7 @@ static void dump_file(const char *file) } enum { + OPT_verbose = 242, OPT_clock = 243, OPT_all = 244, OPT_summary = 245, @@ -722,6 +723,7 @@ void trace_dump(int argc, char **argv) {"clock", no_argument, NULL, OPT_clock}, {"validate", no_argument, NULL, 'v'}, {"help", no_argument, NULL, '?'}, + {"verbose", required_argument, NULL, OPT_verbose}, {NULL, 0, NULL, 0} }; @@ -778,6 +780,10 @@ void trace_dump(int argc, char **argv) case OPT_clock: verbosity |= CLOCK; break; + case OPT_verbose: + if (trace_set_verbose(optarg) < 0) + die("invalid verbose level %s", optarg); + break; default: usage(argv); } diff --git a/tracecmd/trace-usage.c b/tracecmd/trace-usage.c index 8a7e8c7b..1fc11ac3 100644 --- a/tracecmd/trace-usage.c +++ b/tracecmd/trace-usage.c @@ -393,6 +393,7 @@ static struct usage_help usage_help[] = { " --flyrecord information of offset and count of recorded events per CPU\n" " --clock trace clock, saved in the file\n" " -h, --help show usage information\n" + " --verbose 'level' Set the desired log level\n" }, { NULL, NULL, NULL