Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp901157ybl; Wed, 28 Aug 2019 07:00:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhSB+XdjY6M+6ef6Msw1JXbdPudK2rB95IzWsutZnWR1iejris4aCISoN94wYjq4CKuYT9 X-Received: by 2002:a62:e109:: with SMTP id q9mr4841594pfh.71.1567000820249; Wed, 28 Aug 2019 07:00:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567000820; cv=none; d=google.com; s=arc-20160816; b=IuP+hQ3ltZaCNLPfSzwsl6Z3dVq0mMMyRq15lHdFvXGieqrKFrucoyWFIydCfIc9AN KqayJd4zg5l0+goETNc7dETOTJXJLm47fqru0nDJDSlRIncGfg5fxH33z40oXSvH8WfH uEj1zMqTL+gy2zJ/02urDaxdhVDHhGeKOyf3POvzKW3a4HKkyIA3HbkybJC0YvzbZnlw 18OaFx+DRVEPSfo/GMihnH53w/GD9LSgSdRiavH5PwDfNEpMzRIaVirxt45CepxevMi3 peEZfOeEgVMZqw4W6E3m6l3XhdwTaFsf5q+P05FhMVDJuFPG5bbvYEPdp1gMpOvKUOeJ NEBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/ZgJF5PwS7tmrq79PjKENSMuyijTfeO08vktmCL+H2Q=; b=FXL0ss6/229z22cXRAXlVM48xV7+zcc+hczFJlQYt1UbjeniX3e2FBp0gFwrqaV3MV YxJmFkLNqaciKLCMu+PyXNGuEUVntsjFquxzhf6idHdmG1Fb7XSHvESf6ya9BbqmqRIQ stwyKLkuFucWLuT8gL0rfamd2UXqBi1oD4teMSARVYVrFDbdi6L1aQsgC9HiVLiAHQoh IQ4T52Ppkiafkik1jOSMp6d3IFcJSu1OlSHR0RaI7lf/5b4NyD5zUSihYMU3cAD85jek ZvxeqrPKWp1Ffyj3hvTLV/lpME9gpewpOiDURMUMP/cQndcexN2Jt+DVVWBo+uh/3euM GNxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q23si1910940pjp.76.2019.08.28.07.00.03; Wed, 28 Aug 2019 07:00:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726881AbfH1N6n (ORCPT + 99 others); Wed, 28 Aug 2019 09:58:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46116 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726999AbfH1N5w (ORCPT ); Wed, 28 Aug 2019 09:57:52 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9A10FC056808; Wed, 28 Aug 2019 13:57:52 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 002C81001B00; Wed, 28 Aug 2019 13:57:50 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan Subject: [PATCH 15/23] libperf: Add PERF_RECORD_STAT_CONFIG 'struct stat_config_event' to perf/event.h Date: Wed, 28 Aug 2019 15:57:09 +0200 Message-Id: <20190828135717.7245-16-jolsa@kernel.org> In-Reply-To: <20190828135717.7245-1-jolsa@kernel.org> References: <20190828135717.7245-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 28 Aug 2019 13:57:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move the PERF_RECORD_STAT_CONFIG event definition to libperf's event.h. In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions. Link: http://lkml.kernel.org/n/tip-ftr4j2l1by743i4rk9msjbmi@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/lib/include/perf/event.h | 18 ++++++++++++++++++ tools/perf/util/event.c | 2 +- tools/perf/util/event.h | 18 ------------------ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tools/perf/lib/include/perf/event.h b/tools/perf/lib/include/perf/event.h index fe0ce655af17..ba6ed243a31f 100644 --- a/tools/perf/lib/include/perf/event.h +++ b/tools/perf/lib/include/perf/event.h @@ -264,4 +264,22 @@ struct thread_map_event { struct thread_map_event_entry entries[]; }; +enum { + PERF_STAT_CONFIG_TERM__AGGR_MODE = 0, + PERF_STAT_CONFIG_TERM__INTERVAL = 1, + PERF_STAT_CONFIG_TERM__SCALE = 2, + PERF_STAT_CONFIG_TERM__MAX = 3, +}; + +struct stat_config_event_entry { + __u64 tag; + __u64 val; +}; + +struct stat_config_event { + struct perf_event_header header; + __u64 nr; + struct stat_config_event_entry data[]; +}; + #endif /* __LIBPERF_EVENT_H */ diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 85f9f27782b1..2369333d61d8 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -1234,7 +1234,7 @@ void perf_event__read_stat_config(struct perf_stat_config *config, CASE(INTERVAL, interval) #undef CASE default: - pr_warning("unknown stat config term %" PRIu64 "\n", + pr_warning("unknown stat config term %" PRI_lu64 "\n", event->data[i].tag); } } diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index 3a856696c6b1..68531d08dcec 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h @@ -332,24 +332,6 @@ struct events_stats { u32 nr_proc_map_timeout; }; -enum { - PERF_STAT_CONFIG_TERM__AGGR_MODE = 0, - PERF_STAT_CONFIG_TERM__INTERVAL = 1, - PERF_STAT_CONFIG_TERM__SCALE = 2, - PERF_STAT_CONFIG_TERM__MAX = 3, -}; - -struct stat_config_event_entry { - u64 tag; - u64 val; -}; - -struct stat_config_event { - struct perf_event_header header; - u64 nr; - struct stat_config_event_entry data[]; -}; - struct stat_event { struct perf_event_header header; -- 2.21.0