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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E376C4332F for ; Tue, 13 Dec 2022 23:27:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237098AbiLMX1q (ORCPT ); Tue, 13 Dec 2022 18:27:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237034AbiLMX1c (ORCPT ); Tue, 13 Dec 2022 18:27:32 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4F6126AEA for ; Tue, 13 Dec 2022 15:27:31 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id f11-20020a5b01cb000000b0070374b66537so18672477ybp.14 for ; Tue, 13 Dec 2022 15:27:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=4KcsU/b3XyH2KQ+Ac23wDexbNZ59qO2HtUAGBc5g3Tc=; b=YVUOxAG2O4vexzafaKXiqxFFq6XVXzwPJABTGqUVVbEO9apyo7c/MsJRdgasjmAOpn px3ls4XPbyNqxVp2FxeVFfhvR/RSSY0c0A7dpd267nqfHdSr8ATTYXNxVhUx+UFadA9v 8gBH/HDiTN26ymg8IoNZTUnKQYjwBM1iLgXqISO8HS+d/7lZW8hfu012CgiKRwFM85oc A/Kt/oFb9yD39482tBKuQAwP299lhwt6kxTPuBOwu9ckvzJllGkPvxHodK+j8iQ+KoAQ ICf00f6PzpWGIWBKySR4+xb5XTL/wG622Fw670ZKbKSye5v59hTvDxMqVeoUepsaddp6 RpLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4KcsU/b3XyH2KQ+Ac23wDexbNZ59qO2HtUAGBc5g3Tc=; b=AUcFu9MpTJvCVo/7JVqRCBgL084z58/r//udIVoiUMdi1Zpt/gQ9JqLx4CViR9jRpk YFu+tKhQ6f3s5Wdo0RWM44Ip3tH/rTI+WXoCPICdcVUfhEVhpaVA3BFafyXh8NGwOurJ nc+k+RkfFdP+yh4bnXfWDW+2fTWtLxqFuNwHG3wcMqkx6+2GQeBRxrBcTlRRmzZx0riE ebHg8ODN69f9a5KE2PIjARGGniWSI66gHFwSVzwrStXdCQQsQ4L9Ii2eP4IAhpIIV2lD t1dellidU9atezwDm7uBWsppsoAfd0OpLDcSNUq7dMicDG4TwMkz+AcNGVRQU3KG0ZzN A9JA== X-Gm-Message-State: ANoB5plJfVtPJBCbK1bBH/KiAMb17yiJm3LVYprGHyUurSvq1PqyUcF1 99IwslPokp7X/zI08E21dHV7v7CI92dC X-Google-Smtp-Source: AA0mqf7lGZZ4v31cMvNVbWsuRcdcUu/G5Qr1dJkHBTXk6p+od9IpIkYZyFFTc5zjUM888sTF5CpaDWTtO2s5 X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:6268:b448:f7f4:4c2]) (user=irogers job=sendgmr) by 2002:a05:690c:a01:b0:3b2:cbaa:6f2a with SMTP id cg1-20020a05690c0a0100b003b2cbaa6f2amr2927724ywb.500.1670974051035; Tue, 13 Dec 2022 15:27:31 -0800 (PST) Date: Tue, 13 Dec 2022 15:26:49 -0800 In-Reply-To: <20221213232651.1269909-1-irogers@google.com> Message-Id: <20221213232651.1269909-4-irogers@google.com> Mime-Version: 1.0 References: <20221213232651.1269909-1-irogers@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Subject: [PATCH v1 3/5] libtraceevent: Increase libtraceevent logging when verbose From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alexey Bayduraev , Adrian Hunter , Anshuman Khandual , Andi Kleen , James Clark , Sandipan Das , German Gomez , Leo Yan , Timothy Hayes , Kan Liang , Xing Zhengjun , Kim Phillips , Riccardo Mancini , Sean Christopherson , shaomin Deng , Eelco Chaudron , Athira Jajeev , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Cc: Stephane Eranian , Ian Rogers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org libtraceevent has added more levels of debug printout and with changes like: https://lore.kernel.org/linux-trace-devel/20210507095022.1079364-3-tz.stoyanov@gmail.com previously generated output like "registering plugin" is no longer displayed. This change makes it so that if perf's verbose debug output is enabled then the debug and info libtraceevent messages can be displayed. The code is conditionally enabled based on the libtraceevent version as discussed in the RFC: https://lore.kernel.org/lkml/20210610060643.595673-1-irogers@google.com/ Based on previously reverted change: https://lore.kernel.org/linux-perf-users/20210923001024.550263-4-irogers@google.com/ that was reverted due to -Itools/lib being in CFLAGS meaning the traceevent headers couldn't be properly used from the system. Signed-off-by: Ian Rogers --- tools/perf/util/debug.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c index 65e6c22f38e4..cd575460818f 100644 --- a/tools/perf/util/debug.c +++ b/tools/perf/util/debug.c @@ -22,6 +22,7 @@ #include "ui/helpline.h" #include "ui/ui.h" #include "util/parse-sublevel-options.h" +#include "util/trace-event.h" #include @@ -228,6 +229,15 @@ int perf_debug_option(const char *str) /* Allow only verbose value in range (0, 10), otherwise set 0. */ verbose = (verbose < 0) || (verbose > 10) ? 0 : verbose; +#if MAKE_LIBTRACEEVENT_VERSION(1, 3, 0) <= LIBTRACEEVENT_VERSION + if (verbose == 1) + tep_set_loglevel(TEP_LOG_INFO); + else if (verbose == 2) + tep_set_loglevel(TEP_LOG_DEBUG); + else if (verbose >= 3) + tep_set_loglevel(TEP_LOG_ALL); +#endif + return 0; } -- 2.39.0.314.g84b9a713c41-goog