linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf/tool: Fix usage of trace events with '-' in trace system name.
@ 2014-03-24 20:49 Christian Borntraeger
  2014-03-25 10:15 ` Paolo Bonzini
  2014-04-17 14:40 ` Jiri Olsa
  0 siblings, 2 replies; 10+ messages in thread
From: Christian Borntraeger @ 2014-03-24 20:49 UTC (permalink / raw)
  To: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Arnaldo Carvalho de Melo
  Cc: Paolo Bonzini, KVM, linux-s390, Cornelia Huck, linux-kernel,
	Alexander Yarygin, Christian Borntraeger

From: Alexander Yarygin <yarygin@linux.vnet.ibm.com>

Trace events potentially can have a '-' in their trace system name,
e.g. kvm on s390 defines kvm-s390:* tracepoints.
tools/perf could not parse them, because there was no rule for this:
$ sudo ./perf top -e "kvm-s390:*"
invalid or unsupported event: 'kvm-s390:*'

This patch adds an extra rule to event_legacy_tracepoint which handles
those cases. Without the patch, perf will not accept such tracepoints in
the -e option.

Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 tools/perf/util/parse-events.y | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 4eb67ec..dbbb01c 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -299,6 +299,18 @@ PE_PREFIX_MEM PE_VALUE sep_dc
 }
 
 event_legacy_tracepoint:
+PE_NAME '-' PE_NAME ':' PE_NAME
+{
+	struct parse_events_evlist *data = _data;
+	struct list_head *list;
+	char sys_name[strlen($1) + strlen($3) + 2];
+	sprintf(&sys_name, "%s-%s", $1, $3);
+
+	ALLOC_LIST(list);
+	ABORT_ON(parse_events_add_tracepoint(list, &data->idx, &sys_name, $5));
+	$$ = list;
+}
+|
 PE_NAME ':' PE_NAME
 {
 	struct parse_events_evlist *data = _data;
-- 
1.8.4.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] perf/tool: Fix usage of trace events with '-' in trace system name.
  2014-03-24 20:49 [PATCH] perf/tool: Fix usage of trace events with '-' in trace system name Christian Borntraeger
@ 2014-03-25 10:15 ` Paolo Bonzini
  2014-04-17 11:32   ` Jiri Olsa
  2014-04-17 14:40 ` Jiri Olsa
  1 sibling, 1 reply; 10+ messages in thread
From: Paolo Bonzini @ 2014-03-25 10:15 UTC (permalink / raw)
  To: Christian Borntraeger, Peter Zijlstra, Paul Mackerras,
	Ingo Molnar, Arnaldo Carvalho de Melo
  Cc: KVM, linux-s390, Cornelia Huck, linux-kernel, Alexander Yarygin

Il 24/03/2014 21:49, Christian Borntraeger ha scritto:
>  event_legacy_tracepoint:
> +PE_NAME '-' PE_NAME ':' PE_NAME
> +{
> +	struct parse_events_evlist *data = _data;
> +	struct list_head *list;
> +	char sys_name[strlen($1) + strlen($3) + 2];
> +	sprintf(&sys_name, "%s-%s", $1, $3);
> +
> +	ALLOC_LIST(list);
> +	ABORT_ON(parse_events_add_tracepoint(list, &data->idx, &sys_name, $5));
> +	$$ = list;
> +}

Why isn't '-' part of PE_NAME?

Paolo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] perf/tool: Fix usage of trace events with '-' in trace system name.
  2014-03-25 10:15 ` Paolo Bonzini
@ 2014-04-17 11:32   ` Jiri Olsa
  2014-04-17 11:41     ` Christian Borntraeger
  2014-04-21 15:43     ` Alexander Yarygin
  0 siblings, 2 replies; 10+ messages in thread
From: Jiri Olsa @ 2014-04-17 11:32 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Christian Borntraeger, Peter Zijlstra, Paul Mackerras,
	Ingo Molnar, Arnaldo Carvalho de Melo, KVM, linux-s390,
	Cornelia Huck, linux-kernel, Alexander Yarygin

On Tue, Mar 25, 2014 at 11:15:29AM +0100, Paolo Bonzini wrote:
> Il 24/03/2014 21:49, Christian Borntraeger ha scritto:
> > event_legacy_tracepoint:
> >+PE_NAME '-' PE_NAME ':' PE_NAME
> >+{
> >+	struct parse_events_evlist *data = _data;
> >+	struct list_head *list;
> >+	char sys_name[strlen($1) + strlen($3) + 2];
> >+	sprintf(&sys_name, "%s-%s", $1, $3);
> >+
> >+	ALLOC_LIST(list);
> >+	ABORT_ON(parse_events_add_tracepoint(list, &data->idx, &sys_name, $5));
> >+	$$ = list;
> >+}
> 
> Why isn't '-' part of PE_NAME?

hi Paolo ;-)

because it screws cache events parsing.. we need some code factoring
in this part

Acked-by: Jiri Olsa <jolsa@redhat.com>

it'd be nice to add test to tests/parse-events.c, probably s390 specific,
because the parsing code touches the tracepoint format file

thanks,
jirka

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] perf/tool: Fix usage of trace events with '-' in trace system name.
  2014-04-17 11:32   ` Jiri Olsa
@ 2014-04-17 11:41     ` Christian Borntraeger
  2014-04-17 11:45       ` Jiri Olsa
  2014-04-21 15:43     ` Alexander Yarygin
  1 sibling, 1 reply; 10+ messages in thread
From: Christian Borntraeger @ 2014-04-17 11:41 UTC (permalink / raw)
  To: Jiri Olsa, Paolo Bonzini
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, KVM, linux-s390, Cornelia Huck,
	linux-kernel, Alexander Yarygin

On 17/04/14 13:32, Jiri Olsa wrote:
> On Tue, Mar 25, 2014 at 11:15:29AM +0100, Paolo Bonzini wrote:
>> Il 24/03/2014 21:49, Christian Borntraeger ha scritto:
>>> event_legacy_tracepoint:
>>> +PE_NAME '-' PE_NAME ':' PE_NAME
>>> +{
>>> +	struct parse_events_evlist *data = _data;
>>> +	struct list_head *list;
>>> +	char sys_name[strlen($1) + strlen($3) + 2];
>>> +	sprintf(&sys_name, "%s-%s", $1, $3);
>>> +
>>> +	ALLOC_LIST(list);
>>> +	ABORT_ON(parse_events_add_tracepoint(list, &data->idx, &sys_name, $5));
>>> +	$$ = list;
>>> +}
>>
>> Why isn't '-' part of PE_NAME?
> 
> hi Paolo ;-)
> 
> because it screws cache events parsing.. we need some code factoring
> in this part
> 
> Acked-by: Jiri Olsa <jolsa@redhat.com>

Jiri,

can you handle this patch + "perf-kvm: fix of 'Min time' counting in report command" in your tree?

> 
> it'd be nice to add test to tests/parse-events.c, probably s390 specific,
> because the parsing code touches the tracepoint format file

Alexander,

can you have a look to provide a simple test for perf that checks that trace events like kvm-s390 are handled properly?

Thanks

Christian


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] perf/tool: Fix usage of trace events with '-' in trace system name.
  2014-04-17 11:41     ` Christian Borntraeger
@ 2014-04-17 11:45       ` Jiri Olsa
  0 siblings, 0 replies; 10+ messages in thread
From: Jiri Olsa @ 2014-04-17 11:45 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: Paolo Bonzini, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, KVM, linux-s390, Cornelia Huck,
	linux-kernel, Alexander Yarygin

On Thu, Apr 17, 2014 at 01:41:56PM +0200, Christian Borntraeger wrote:
> On 17/04/14 13:32, Jiri Olsa wrote:
> > On Tue, Mar 25, 2014 at 11:15:29AM +0100, Paolo Bonzini wrote:
> >> Il 24/03/2014 21:49, Christian Borntraeger ha scritto:
> >>> event_legacy_tracepoint:
> >>> +PE_NAME '-' PE_NAME ':' PE_NAME
> >>> +{
> >>> +	struct parse_events_evlist *data = _data;
> >>> +	struct list_head *list;
> >>> +	char sys_name[strlen($1) + strlen($3) + 2];
> >>> +	sprintf(&sys_name, "%s-%s", $1, $3);
> >>> +
> >>> +	ALLOC_LIST(list);
> >>> +	ABORT_ON(parse_events_add_tracepoint(list, &data->idx, &sys_name, $5));
> >>> +	$$ = list;
> >>> +}
> >>
> >> Why isn't '-' part of PE_NAME?
> > 
> > hi Paolo ;-)
> > 
> > because it screws cache events parsing.. we need some code factoring
> > in this part
> > 
> > Acked-by: Jiri Olsa <jolsa@redhat.com>
> 
> Jiri,
> 
> can you handle this patch + "perf-kvm: fix of 'Min time' counting in report command" in your tree?

yep, I queued both of them

jirka

> 
> > 
> > it'd be nice to add test to tests/parse-events.c, probably s390 specific,
> > because the parsing code touches the tracepoint format file
> 
> Alexander,
> 
> can you have a look to provide a simple test for perf that checks that trace events like kvm-s390 are handled properly?
> 
> Thanks
> 
> Christian
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] perf/tool: Fix usage of trace events with '-' in trace system name.
  2014-03-24 20:49 [PATCH] perf/tool: Fix usage of trace events with '-' in trace system name Christian Borntraeger
  2014-03-25 10:15 ` Paolo Bonzini
@ 2014-04-17 14:40 ` Jiri Olsa
  2014-04-23 11:12   ` Christian Borntraeger
  1 sibling, 1 reply; 10+ messages in thread
From: Jiri Olsa @ 2014-04-17 14:40 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Paolo Bonzini, KVM, linux-s390,
	Cornelia Huck, linux-kernel, Alexander Yarygin

On Mon, Mar 24, 2014 at 09:49:00PM +0100, Christian Borntraeger wrote:
> From: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
> 
> Trace events potentially can have a '-' in their trace system name,
> e.g. kvm on s390 defines kvm-s390:* tracepoints.
> tools/perf could not parse them, because there was no rule for this:
> $ sudo ./perf top -e "kvm-s390:*"
> invalid or unsupported event: 'kvm-s390:*'
> 
> This patch adds an extra rule to event_legacy_tracepoint which handles
> those cases. Without the patch, perf will not accept such tracepoints in
> the -e option.
> 
> Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  tools/perf/util/parse-events.y | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
> index 4eb67ec..dbbb01c 100644
> --- a/tools/perf/util/parse-events.y
> +++ b/tools/perf/util/parse-events.y
> @@ -299,6 +299,18 @@ PE_PREFIX_MEM PE_VALUE sep_dc
>  }
>  
>  event_legacy_tracepoint:
> +PE_NAME '-' PE_NAME ':' PE_NAME
> +{
> +	struct parse_events_evlist *data = _data;
> +	struct list_head *list;
> +	char sys_name[strlen($1) + strlen($3) + 2];

hum, could you limit the size of sys_name array with some
sane value? those strlens make me nervous :-\

thanks,
jirka

> +	sprintf(&sys_name, "%s-%s", $1, $3);
> +
> +	ALLOC_LIST(list);
> +	ABORT_ON(parse_events_add_tracepoint(list, &data->idx, &sys_name, $5));
> +	$$ = list;
> +}
> +|
>  PE_NAME ':' PE_NAME
>  {
>  	struct parse_events_evlist *data = _data;
> -- 
> 1.8.4.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] perf/tool: Fix usage of trace events with '-' in trace system name.
  2014-04-17 11:32   ` Jiri Olsa
  2014-04-17 11:41     ` Christian Borntraeger
@ 2014-04-21 15:43     ` Alexander Yarygin
  2014-04-23 11:45       ` Jiri Olsa
  1 sibling, 1 reply; 10+ messages in thread
From: Alexander Yarygin @ 2014-04-21 15:43 UTC (permalink / raw)
  To: Jiri Olsa, Christian Borntraeger
  Cc: Paolo Bonzini, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, KVM, linux-s390, Cornelia Huck,
	linux-kernel, Alexander Yarygin

At Thu, 17 Apr 2014 13:32:21 +0200,
Jiri Olsa wrote:
> 
> On Tue, Mar 25, 2014 at 11:15:29AM +0100, Paolo Bonzini wrote:
> > Il 24/03/2014 21:49, Christian Borntraeger ha scritto:
> > > event_legacy_tracepoint:
> > >+PE_NAME '-' PE_NAME ':' PE_NAME
> > >+{
> > >+	struct parse_events_evlist *data = _data;
> > >+	struct list_head *list;
> > >+	char sys_name[strlen($1) + strlen($3) + 2];
> > >+	sprintf(&sys_name, "%s-%s", $1, $3);
> > >+
> > >+	ALLOC_LIST(list);
> > >+	ABORT_ON(parse_events_add_tracepoint(list, &data->idx, &sys_name, $5));
> > >+	$$ = list;
> > >+}
> > 
> > Why isn't '-' part of PE_NAME?
> 
> hi Paolo ;-)
> 
> because it screws cache events parsing.. we need some code factoring
> in this part
> 
> Acked-by: Jiri Olsa <jolsa@redhat.com>
> 
> it'd be nice to add test to tests/parse-events.c, probably s390 specific,
> because the parsing code touches the tracepoint format file
> 

Hi,

Hmm, looks like we can't simply add arch-specific test:

--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -1346,6 +1346,12 @@ static struct evlist_test test__events[] = {
 		.name  = "{cycles,cache-misses,branch-misses}:D",
 		.check = test__pinned_group,
 	},
+#if defined(__s390x__)
+	[42] = {
+		.name  = "kvm-s390:kvm_s390_create_vm",
+		.check = test__checkevent_tracepoint,
+	},
+#endif /* and what will be the next number: 42 or 43? */
 };

 static struct evlist_test test__events_pmu[] = {


Because it breaks explicit numbering of test__events[].
I can suggest to move numeration into evlist_test, i.e.

--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -1174,25 +1174,30 @@ static int test__all_tracepoints(struct perf_evlist *evlist)
 struct evlist_test {
 	const char *name;
 	__u32 type;
+	int index;
 	int (*check)(struct perf_evlist *evlist);
 };
 
 static struct evlist_test test__events[] = {
-	[0] = {
+	{
 		.name  = "syscalls:sys_enter_open",
 		.check = test__checkevent_tracepoint,
+		.index = 0;
 	},
...

or just to remove it?

How do you think?


And a bit of offtopic :)
Apparently, s390 doesn't have syscalls:*, so some of the tests
don't work properly (or maybe I missed something? I set CONFIG_FTRACE_SYSCALLS
to 'y' in my config: still no syscalls:*).

What do you think about this idea:

--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -1177,13 +1177,21 @@ struct evlist_test {
 	int (*check)(struct perf_evlist *evlist);
 };

+#if !defined(__s390x__)
+#define TP_SYS_NAME "syscalls"
+#define TP_EVENT_NAME "sys_enter_open"
+#else
+#define TP_SYS_NAME "sched"
+#define TP_EVENT_NAME "sched_wakeup"
+#endif
+
 static struct evlist_test test__events[] = {
 	[0] = {
-		.name  = "syscalls:sys_enter_open",
+		.name  = TP_SYS_NAME ":" TP_EVENT_NAME,
 		.check = test__checkevent_tracepoint,
 	},

... and so on?

Also, test_pmu() looks at /sys/bus/event_source/devices/cpu/
but instead of "cpu/" on s390 there are "cpum_sf/" and "cpum_cf/",
so pmu tests don't work either..


Thanks


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] perf/tool: Fix usage of trace events with '-' in trace system name.
  2014-04-17 14:40 ` Jiri Olsa
@ 2014-04-23 11:12   ` Christian Borntraeger
  0 siblings, 0 replies; 10+ messages in thread
From: Christian Borntraeger @ 2014-04-23 11:12 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Paolo Bonzini, KVM, linux-s390,
	Cornelia Huck, linux-kernel, Alexander Yarygin

On 17/04/14 16:40, Jiri Olsa wrote:
> On Mon, Mar 24, 2014 at 09:49:00PM +0100, Christian Borntraeger wrote:
>> From: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
>>
>> Trace events potentially can have a '-' in their trace system name,
>> e.g. kvm on s390 defines kvm-s390:* tracepoints.
>> tools/perf could not parse them, because there was no rule for this:
>> $ sudo ./perf top -e "kvm-s390:*"
>> invalid or unsupported event: 'kvm-s390:*'
>>
>> This patch adds an extra rule to event_legacy_tracepoint which handles
>> those cases. Without the patch, perf will not accept such tracepoints in
>> the -e option.
>>
>> Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> ---
>>  tools/perf/util/parse-events.y | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
>> index 4eb67ec..dbbb01c 100644
>> --- a/tools/perf/util/parse-events.y
>> +++ b/tools/perf/util/parse-events.y
>> @@ -299,6 +299,18 @@ PE_PREFIX_MEM PE_VALUE sep_dc
>>  }
>>  
>>  event_legacy_tracepoint:
>> +PE_NAME '-' PE_NAME ':' PE_NAME
>> +{
>> +	struct parse_events_evlist *data = _data;
>> +	struct list_head *list;
>> +	char sys_name[strlen($1) + strlen($3) + 2];
> 
> hum, could you limit the size of sys_name array with some
> sane value? those strlens make me nervous :-\

Right. Something like
char sys_name[128];
[...]

snprintf(&sys_name, 128, "%s-%s", $1, $3);

should be enough for all trace event names. And if not, the event should simply fail.

Alexander,

can you send an updates patch?


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] perf/tool: Fix usage of trace events with '-' in trace system name.
  2014-04-21 15:43     ` Alexander Yarygin
@ 2014-04-23 11:45       ` Jiri Olsa
  2014-04-23 12:34         ` Christian Borntraeger
  0 siblings, 1 reply; 10+ messages in thread
From: Jiri Olsa @ 2014-04-23 11:45 UTC (permalink / raw)
  To: Alexander Yarygin
  Cc: Christian Borntraeger, Paolo Bonzini, Peter Zijlstra,
	Paul Mackerras, Ingo Molnar, Arnaldo Carvalho de Melo, KVM,
	linux-s390, Cornelia Huck, linux-kernel

On Mon, Apr 21, 2014 at 07:43:50PM +0400, Alexander Yarygin wrote:

SNIP

> 
> --- a/tools/perf/tests/parse-events.c
> +++ b/tools/perf/tests/parse-events.c
> @@ -1346,6 +1346,12 @@ static struct evlist_test test__events[] = {
>  		.name  = "{cycles,cache-misses,branch-misses}:D",
>  		.check = test__pinned_group,
>  	},
> +#if defined(__s390x__)
> +	[42] = {
> +		.name  = "kvm-s390:kvm_s390_create_vm",
> +		.check = test__checkevent_tracepoint,
> +	},
> +#endif /* and what will be the next number: 42 or 43? */
>  };
> 
>  static struct evlist_test test__events_pmu[] = {
> 
> 
> Because it breaks explicit numbering of test__events[].
> I can suggest to move numeration into evlist_test, i.e.
> 
> --- a/tools/perf/tests/parse-events.c
> +++ b/tools/perf/tests/parse-events.c
> @@ -1174,25 +1174,30 @@ static int test__all_tracepoints(struct perf_evlist *evlist)
>  struct evlist_test {
>  	const char *name;
>  	__u32 type;
> +	int index;
>  	int (*check)(struct perf_evlist *evlist);
>  };
>  
>  static struct evlist_test test__events[] = {
> -	[0] = {
> +	{
>  		.name  = "syscalls:sys_enter_open",
>  		.check = test__checkevent_tracepoint,
> +		.index = 0;
>  	},
> ...
> 
> or just to remove it?

right, that numbering is there to ease the search for test,
and is printed for -v option

the 'index' field should be fine, and please print it
out for '-v' option


> 
> How do you think?
> 
> 
> And a bit of offtopic :)
> Apparently, s390 doesn't have syscalls:*, so some of the tests
> don't work properly (or maybe I missed something? I set CONFIG_FTRACE_SYSCALLS
> to 'y' in my config: still no syscalls:*).
> 
> What do you think about this idea:
> 
> --- a/tools/perf/tests/parse-events.c
> +++ b/tools/perf/tests/parse-events.c
> @@ -1177,13 +1177,21 @@ struct evlist_test {
>  	int (*check)(struct perf_evlist *evlist);
>  };
> 
> +#if !defined(__s390x__)
> +#define TP_SYS_NAME "syscalls"
> +#define TP_EVENT_NAME "sys_enter_open"
> +#else
> +#define TP_SYS_NAME "sched"
> +#define TP_EVENT_NAME "sched_wakeup"
> +#endif
> +
>  static struct evlist_test test__events[] = {
>  	[0] = {
> -		.name  = "syscalls:sys_enter_open",
> +		.name  = TP_SYS_NAME ":" TP_EVENT_NAME,
>  		.check = test__checkevent_tracepoint,
>  	},
> 
> ... and so on?

that looks fine.. also we could use just generic tracepoints
like the 'sched' ones

> 
> Also, test_pmu() looks at /sys/bus/event_source/devices/cpu/
> but instead of "cpu/" on s390 there are "cpum_sf/" and "cpum_cf/",
> so pmu tests don't work either..

we could #ifdef the pmu name for s390 and other archs

or make it more fancy and detect it by using pmu.c code,
please check perf_pmu__scan,perf_pmu__find functions

thanks,
jirka

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] perf/tool: Fix usage of trace events with '-' in trace system name.
  2014-04-23 11:45       ` Jiri Olsa
@ 2014-04-23 12:34         ` Christian Borntraeger
  0 siblings, 0 replies; 10+ messages in thread
From: Christian Borntraeger @ 2014-04-23 12:34 UTC (permalink / raw)
  To: Jiri Olsa, Alexander Yarygin
  Cc: Paolo Bonzini, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, KVM, linux-s390, Cornelia Huck,
	linux-kernel

On 23/04/14 13:45, Jiri Olsa wrote:
> On Mon, Apr 21, 2014 at 07:43:50PM +0400, Alexander Yarygin wrote:
[...]
>> And a bit of offtopic :)
>> Apparently, s390 doesn't have syscalls:*, so some of the tests
>> don't work properly (or maybe I missed something? I set CONFIG_FTRACE_SYSCALLS
>> to 'y' in my config: still no syscalls:*).

Strange, on my system I have syscall trace points on s390.
Maybe some additional dependency of CONFIG_FTRACE_SYSCALLS that is not catched
via Kconfig?

>>
>> What do you think about this idea:
>>
>> --- a/tools/perf/tests/parse-events.c
>> +++ b/tools/perf/tests/parse-events.c
>> @@ -1177,13 +1177,21 @@ struct evlist_test {
>>  	int (*check)(struct perf_evlist *evlist);
>>  };
>>
>> +#if !defined(__s390x__)
>> +#define TP_SYS_NAME "syscalls"
>> +#define TP_EVENT_NAME "sys_enter_open"
>> +#else
>> +#define TP_SYS_NAME "sched"
>> +#define TP_EVENT_NAME "sched_wakeup"
>> +#endif
>> +
>>  static struct evlist_test test__events[] = {
>>  	[0] = {
>> -		.name  = "syscalls:sys_enter_open",
>> +		.name  = TP_SYS_NAME ":" TP_EVENT_NAME,
>>  		.check = test__checkevent_tracepoint,
>>  	},
>>
>> ... and so on?
> 
> that looks fine.. also we could use just generic tracepoints
> like the 'sched' ones

I think generic tracepoints are preferred over ifdef, but as I said I have syscalls.

Christian

Christian





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-04-23 12:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-24 20:49 [PATCH] perf/tool: Fix usage of trace events with '-' in trace system name Christian Borntraeger
2014-03-25 10:15 ` Paolo Bonzini
2014-04-17 11:32   ` Jiri Olsa
2014-04-17 11:41     ` Christian Borntraeger
2014-04-17 11:45       ` Jiri Olsa
2014-04-21 15:43     ` Alexander Yarygin
2014-04-23 11:45       ` Jiri Olsa
2014-04-23 12:34         ` Christian Borntraeger
2014-04-17 14:40 ` Jiri Olsa
2014-04-23 11:12   ` Christian Borntraeger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).