From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yk0-x22a.google.com (mail-yk0-x22a.google.com [IPv6:2607:f8b0:4002:c07::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4383E1A0590 for ; Wed, 28 May 2014 10:28:32 +1000 (EST) Received: by mail-yk0-f170.google.com with SMTP id 10so7844931ykt.1 for ; Tue, 27 May 2014 17:28:29 -0700 (PDT) From: Cody P Schafer To: LKML , Linux PPC , Arnaldo Carvalho de Melo , Ingo Molnar , Paul Mackerras , Peter Zijlstra Subject: [PATCH 14/16] perf: add PMU_EVENT_ATTR_STRING() helper Date: Tue, 27 May 2014 17:22:09 -0700 Message-Id: <1401236684-10579-15-git-send-email-dev@codyps.com> In-Reply-To: <1401236684-10579-1-git-send-email-dev@codyps.com> References: <1401236684-10579-1-git-send-email-dev@codyps.com> Cc: Sukadev Bhattiprolu , Cody P Schafer List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Helper for constructing static struct perf_pmu_events_attr s. CC: Sukadev Bhattiprolu Signed-off-by: Cody P Schafer --- include/linux/perf_event.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 6c1d6dd..1313171 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -876,6 +876,13 @@ static struct perf_pmu_events_attr _var = { \ .id = _id, \ }; +#define PMU_EVENT_ATTR_STRING(_name, _var, _value) \ +static struct perf_pmu_events_attr _var = { \ + .attr = __ATTR(_name, 0444, perf_event_sysfs_show, NULL), \ + .event_str = _value, \ +}; + + #define PMU_FORMAT_ATTR(_name, _format) \ static ssize_t \ _name##_show(struct device *dev, \ -- 1.9.3