Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6926308rwl; Mon, 9 Jan 2023 15:11:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXvvgD3BEaYd6Yxl3YeY+6EPnKeMBWxSQFAnYSQmx/uU/WLN6UTwzaGHtgRv/OOmjK+OJAwW X-Received: by 2002:a17:902:f80c:b0:189:340c:20c4 with SMTP id ix12-20020a170902f80c00b00189340c20c4mr68896250plb.66.1673305900318; Mon, 09 Jan 2023 15:11:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673305900; cv=none; d=google.com; s=arc-20160816; b=m8ddZhl9iqh+YTR2AZw2QwLrW/YiXlcyjHLhWWdJQLmIvkwIxNsh2Eg6w+ni39n/uu CJNBNNY4utOdcivXl07LwJB2i1jwItujoQTTHobrPaNXeeRfcHATZujLkB82gXBrD17a TfusS0XdtfKX1nmyN4mbIRtL+ExQad5vvpc70aypBtCn0m4m1rJ+j44XZb2X9uqjNsbB h+wtBuezPnD2Ww4mq805KIZUmAOTWlLSemva0ik8HTM7H6OvtHzOR4LhiMko9D6xjXC7 UEjf7D/WJ1Jnyw4IXaLnVuv1FPVIP4CXLQ2MCUVyYPgSzcwkjzGymhiaTAZMSYFrwrwp +hRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=NFrSxVrfdRZYprem1a+EonI6bqjM3AdjO9gRlJ+kQ1E=; b=o9QyImuCVNVesZBoL519gGCpLAHguqdTsVsfXI0+cjcpnVZLuw+x10rpwZAp5al9C2 B0qdZv+bwU3XgD4WgIZncc2uKpWGyZKqyDc4rVi4Dr3gjv9BmtZTD0kqRjXBexvOtdDb YZawKRd2pYuBWetiKdk4Zm0N53eFipVZdpyOs3rQe+lCUL/wK8wv9EqbkgQLMlOBNSKK HejLowh+EFLUPLOQUJujOPBN1o9W/hVrw/euMNYc/7wtxoeWSX0g6t/N7IxJxCOQn2u/ Sfr7E8hVK6o9kBgYFbgNFVpblls0MbFto4iRqI+wlHFqPlraua9y6ZIDbQOU+XhJpiLk ba2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ppMi4dw2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a10-20020a170902ecca00b00192a69cd30dsi10283627plh.567.2023.01.09.15.11.33; Mon, 09 Jan 2023 15:11:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ppMi4dw2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237223AbjAIWcC (ORCPT + 53 others); Mon, 9 Jan 2023 17:32:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237862AbjAIWbs (ORCPT ); Mon, 9 Jan 2023 17:31:48 -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 8B1281869D for ; Mon, 9 Jan 2023 14:31:47 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id r8-20020a252b08000000b007b989d5e105so7200534ybr.11 for ; Mon, 09 Jan 2023 14:31:47 -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=NFrSxVrfdRZYprem1a+EonI6bqjM3AdjO9gRlJ+kQ1E=; b=ppMi4dw2Slp1jnmhvss74/eHVmvHieaVlcIWBKpzDDUUoVO74G5rN55j9D0jvTQSNw 8/qn1YeUHnKjir3CaOQO/bm8jZ0gQ/eVsS7i4AFdaFhZWDksJE3owdE/2ZgGM50Cwx2c YTh/RZRsx/5+gvRsul6MEjRu5RY+Ij/6sH0fDJbvl9X26T4sXTRDGbyBYuX9WE4Aihd3 eC7M0Ll+S88ye6K27g4T7F9ZmEqqjlfH3hSoZl2eQ1OsyhSKU1zb3u+NYEyVPZlZcdG0 i+oV3AWmI5H5sKOdPAJxFjaFLhPOrmJl5dVOhA/5T7skkgRBuZTUfmAK+pP0tXGLq6G7 g1LQ== 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=NFrSxVrfdRZYprem1a+EonI6bqjM3AdjO9gRlJ+kQ1E=; b=7zXzv4TxtHnz1Bpao6Xx/jl6DBjbdf79Ncj/acvBVefHimGXpn38C4GOh1xUU7tVQs IwUdEUHAGwEvkBOEaax/NLW13okuQv2cmO71Q8Oq7bnmLTSmO7J17ej3EvSWazenSYjw aqpm33SaEnjPSMycLpPx529RwozfxLrQJrVH7Ik6zqpKJPFZM60pQnOEBgN2A83Q08/s 3gIn6GQxS/YKStRSt+aNg3jh6kWkdyXJDlEd1Uo3RUPY4AcgIK9J5icZJbkklceVzGil JJGkiLcjfx+brP36aum37MohpMV1tFMG5zkCtLaraqWnefwZCTapMHFSEy6VNo1A8hsE Wo0w== X-Gm-Message-State: AFqh2ko/ZWmtplAQ6UAHdBKJ685zDRpEL1cRH/8rrt7GFt788XLtw3Mn oxjio5XVz4x3N+A+ih3gQFhUbdRGoaef X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:59e7:81ad:bc43:d9dc]) (user=irogers job=sendgmr) by 2002:a25:3055:0:b0:6fb:b4af:e56e with SMTP id w82-20020a253055000000b006fbb4afe56emr5643173ybw.60.1673303506855; Mon, 09 Jan 2023 14:31:46 -0800 (PST) Date: Mon, 9 Jan 2023 14:31:10 -0800 In-Reply-To: <20230109223110.1201541-1-irogers@google.com> Message-Id: <20230109223110.1201541-2-irogers@google.com> Mime-Version: 1.0 References: <20230109223110.1201541-1-irogers@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Subject: [PATCH v1 2/2] perf debug: 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 , Adrian Hunter , Yang Jihong , Kan Liang , Kim Phillips , German Gomez , Sean Christopherson , Paolo Bonzini , Eelco Chaudron , Leo Yan , Athira Rajeev , Stephane Eranian , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ian Rogers Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. This change was previously posted: https://lore.kernel.org/linux-perf-users/20210923001024.550263-4-irogers@google.com/ and reverted: https://lore.kernel.org/linux-perf-users/20220109153446.160593-1-acme@kernel.org/ The previous failure was due to -Itools/lib being on the include path and libtraceevent in tools/lib being version 1.1.0. This meant that when LIBTRACEEVENT_VERSION was 1.3.0 the #if succeeded, but the header file for libtraceevent (taken from tools/lib rather than the intended /usr/include) was for version 1.1.0 and function definitions were missing. Since the previous issue the -Itools/lib include path has been removed: https://lore.kernel.org/lkml/20221109184914.1357295-1-irogers@google.com/ As well as libtraceevent 1.1.0 has been removed from tools/lib: https://lore.kernel.org/lkml/20221130062935.2219247-1-irogers@google.com/ Signed-off-by: Ian Rogers --- tools/perf/util/debug.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c index 190e818a0717..88378c4c5dd9 100644 --- a/tools/perf/util/debug.c +++ b/tools/perf/util/debug.c @@ -19,12 +19,19 @@ #include "debug.h" #include "print_binary.h" #include "target.h" +#include "trace-event.h" #include "ui/helpline.h" #include "ui/ui.h" #include "util/parse-sublevel-options.h" #include +#ifdef HAVE_LIBTRACEEVENT +#include +#else +#define LIBTRACEEVENT_VERSION 0 +#endif + int verbose; int debug_peo_args; bool dump_trace = false, quiet = false; @@ -228,6 +235,14 @@ 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 LIBTRACEEVENT_VERSION >= MAKE_LIBTRACEEVENT_VERSION(1, 3, 0) + 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