From nobody Thu Sep 18 01:19:04 2025 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 AB208C4332F for ; Tue, 13 Dec 2022 23:27:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237032AbiLMX1i (ORCPT ); Tue, 13 Dec 2022 18:27:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237050AbiLMX1Z (ORCPT ); Tue, 13 Dec 2022 18:27:25 -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 10BFD1AA1C for ; Tue, 13 Dec 2022 15:27:24 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id a5-20020a25af05000000b006e450a5e507so18865330ybh.22 for ; Tue, 13 Dec 2022 15:27:24 -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=Nto1ePcvoNdo0gJd4FRIsAa3aTl5xw4C0we0lXrYi4o=; b=oaxFlW2ge9haPbT6hCAVVmPuTox9DW+MdJNbZ0iwTokh/4XBkQYtfdusDGVsroQCBm 9cjRzTm2cTtoTugbzyCsz2kAHTjET5PTm0Qk0Vytd93WKj/92dwBthyYMEWpJ4MTqXXZ Kgspw5ZoKtAmQTgags/2mTbzHSF1im/xe5z7xwqmMxY+MpgtR2QCiepGpC+pSAjeR62r af+wkR/DSxLYLJ6v8UzQYo8yEedKseMcvnt7JbQHB+veoq0VjssEp6Vl9Tr9PuxO2F17 A3OnHm0NqQzzvD7NNSu2YgWdnWtZRBASIIw6rkBU4yPgO0G6Iw9CrmSsI4xx9udJ5Lje 3Bjg== 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=Nto1ePcvoNdo0gJd4FRIsAa3aTl5xw4C0we0lXrYi4o=; b=w/R9dBGV9L9rCXXExogH0ox5L+JbF1lxguj/gfXbQES2jsV4GxS+ZkO5q8yCuYis0/ KduJcKnFOEgzK6IEcTqKeEsB3dmq9c8OIC4TJcVEV+9SYFThuljJsP/a7AoA+dkUXwqy Oh9jawDIRw0K4ySFeOHx01agWJDQt477kD0pvIRRnkaOEmiJJZnopRtQhutg7RL2dhSX m7Jd6fX7A6PhWKAuar7TpVSMR4aEax/xZuyvNMu86BeIWd2h3MVLm6Cvz8pMgFGwh2oL s7KG/lQpRm2YoPCX8ZjPgFHeoxBaeCzqtybT1KJeO1YYx4Re1aQxpjMkzM/DWU3ltvAb BVFw== X-Gm-Message-State: ANoB5pkmo90Gq9lVLZtOagV/XzLuMYo8HBdWlP/v0d6w9eBo1FmEOzM0 BGXMRFXSTo1xu/3KALeR/+9ZDADk+Rvz X-Google-Smtp-Source: AA0mqf7zKBCVtwi4aB0KEabefvL0KR/RBin8ahJp49ddNoCoU3ThDFo9mNYaPbpMu1R7lGgciCKfGEWA/gYy X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:6268:b448:f7f4:4c2]) (user=irogers job=sendgmr) by 2002:a5b:f42:0:b0:6fd:e4ef:5b1d with SMTP id y2-20020a5b0f42000000b006fde4ef5b1dmr25692919ybr.99.1670974043252; Tue, 13 Dec 2022 15:27:23 -0800 (PST) Date: Tue, 13 Dec 2022 15:26:48 -0800 In-Reply-To: <20221213232651.1269909-1-irogers@google.com> Message-Id: <20221213232651.1269909-3-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 2/5] perf trace-event: Add libtraceevent version tools to header 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Allow comparisons like: \#if MAKE_LIBTRACEEVENT_VERSION(1, 3, 0) <=3D LIBTRACEEVENT_VERSION Based on previously reverted: https://lore.kernel.org/linux-perf-users/20210923001024.550263-4-irogers@go= ogle.com/ Signed-off-by: Ian Rogers --- tools/perf/util/trace-event.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h index add6c5d9531c..1fbf4c3f8809 100644 --- a/tools/perf/util/trace-event.h +++ b/tools/perf/util/trace-event.h @@ -6,6 +6,19 @@ #include #include =20 +#ifdef HAVE_LIBTRACEEVENT +#include +#endif + +#define MAKE_LIBTRACEEVENT_VERSION(a, b, c) ((a)*255*255+(b)*255+(c)) +#ifndef LIBTRACEEVENT_VERSION +/* + * If LIBTRACEEVENT_VERSION wasn't computed then set to version 1.1.0 that + * previously shipped with the Linux kernel tools. + */ +#define LIBTRACEEVENT_VERSION MAKE_LIBTRACEEVENT_VERSION(1, 1, 0) +#endif + struct evlist; struct machine; struct perf_sample; --=20 2.39.0.314.g84b9a713c41-goog