From patchwork Mon Jan 9 22:31:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 41193 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2416798wrt; Mon, 9 Jan 2023 14:35:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXvhhyjqhNBUxE3Oru2af6S0Lv7ew9IxZs1/L+R7MmgyUHYxzZ06CEYKlIvohYIO0QlT7rCb X-Received: by 2002:a17:902:c106:b0:193:24fb:ec65 with SMTP id 6-20020a170902c10600b0019324fbec65mr8635314pli.56.1673303712015; Mon, 09 Jan 2023 14:35:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673303711; cv=none; d=google.com; s=arc-20160816; b=dunhgpNl4cRDITxfcu63B27gBzbaSXLVVsrVhtLBDrrU1Dq56zTLlE4+0wc3A40FoV ASraGjI5zD1BeU0WSXOu4eox+Xok1+YxuFykjM1U0asyNEiMKtKlgc60gWosVPQZ/ej2 WrI5UvKPZWGX2JIVZQGa87/9O4IIK1nEr2ZyN1l/w2oVvHDOv7X73JmjPAuc6JdyjiHq yhtnu5yeoFapQb2AkGwq3aHsGfUxu0HuyV2S9BuWkVkVil07Xcd7yqQuUt6yPa77GQGk CtsLn5E5PkSRearqGhoSVVpFx/fjVGf0ImwOQV+TWnuw3ADdCnbvT2UotEh/fCxL1Abj MoKg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t28-20020a63461c000000b004703be83ebesi9768417pga.79.2023.01.09.14.34.59; Mon, 09 Jan 2023 14:35:11 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754586113323440085?= X-GMAIL-MSGID: =?utf-8?q?1754586113323440085?= 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; }