Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754266AbdLHPjJ (ORCPT ); Fri, 8 Dec 2017 10:39:09 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:52156 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754242AbdLHPjC (ORCPT ); Fri, 8 Dec 2017 10:39:02 -0500 Subject: Re: [RFC PATCH 2/5] perf jevents: add support for arch recommended events To: Jiri Olsa References: <1512490399-94107-1-git-send-email-john.garry@huawei.com> <1512490399-94107-3-git-send-email-john.garry@huawei.com> <20171206133752.GB12508@krava> <20171208123137.GF2799@krava> CC: , , , , , , , , , , , , , , , From: John Garry Message-ID: Date: Fri, 8 Dec 2017 15:38:06 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20171208123137.GF2799@krava> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.202.227.238] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2116 Lines: 82 On 08/12/2017 12:31, Jiri Olsa wrote: > On Wed, Dec 06, 2017 at 02:40:10PM +0000, John Garry wrote: >> On 06/12/2017 13:37, Jiri Olsa wrote: >>> On Wed, Dec 06, 2017 at 12:13:16AM +0800, John Garry wrote: >>> >>> SNIP >>> >>>> --- >>>> tools/perf/pmu-events/jevents.c | 215 ++++++++++++++++++++++++++++++++++++---- >>>> 1 file changed, 198 insertions(+), 17 deletions(-) >>>> >>>> diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c >>>> index a0d489e..a820ed4 100644 >>>> --- a/tools/perf/pmu-events/jevents.c >>>> +++ b/tools/perf/pmu-events/jevents.c >>>> @@ -42,6 +42,7 @@ >>>> #include >>>> #include /* getrlimit */ >>>> #include /* getrlimit */ >>>> +#include >>>> #include >>>> #include >>>> #include "jsmn.h" >>>> @@ -366,6 +367,94 @@ static int print_events_table_entry(void *data, char *name, char *event, >>>> return 0; >>>> } >>>> >>>> +struct event_struct { >>>> + char *name; >>>> + char *event; >>>> + char *desc; >>>> + char *long_desc; >>>> + char *pmu; >>>> + char *unit; >>>> + char *perpkg; >>>> + char *metric_expr; >>>> + char *metric_name; >>>> + char *metric_group; >>>> + LIST_ENTRY(event_struct) list; >>> >>> is there any reason you don't use the 'struct list_head' ? >>> I dont think we want another thingie involved for lists >> >> Hi jirka, >> Hi jirka, >> The linux kernel headers are not used for jevents tool. I would rather use >> them if possible... > > should be as easy as adding #include ;-) > Hi jirka, I think the issue is that jevents is a "hostprogs", which does not use kernel headers. FWIW, here is the symptom: pmu-events/jevents.c:51:24: fatal error: linux/list.h: No such file or directory #include ^ compilation terminated. mv: cannot stat ?pmu-events/.jevents.o.tmp?: No such file or directory perf tool build is different. Much appreciated, John > it's heavily used within perf and I'm pretty sure we want > to keep around just one way of doing lists > > thanks, > jirka > > . >