All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: fix perf-lock report coredump
@ 2012-07-11  1:06 Jovi Zhang
  2012-07-11  2:20 ` David Ahern
  0 siblings, 1 reply; 4+ messages in thread
From: Jovi Zhang @ 2012-07-11  1:06 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Arnaldo Carvalho de Melo, Peter Zijlstra, LKML

>From 4b363bf16c12b76788fbace1475123b7214ae58d Mon Sep 17 00:00:00 2001
From: Jovi Zhang <bookjovi@gmail.com>
Date: Wed, 11 Jul 2012 16:53:57 +0800
Subject: [PATCH] perf: fix perf-lock report coredump

Check sample type event raw_data is existed in perf.data firstly,
then invoke process_raw_event, otherwise it will coredump.

Signed-off-by: Jovi Zhang <bookjovi@gmail.com>
---
 tools/perf/builtin-lock.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index fd53319..4b0c230 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -860,7 +860,9 @@ static int process_sample_event(struct perf_tool
*tool __used,
 		return -1;
 	}

-	process_raw_event(sample->raw_data, sample->cpu, sample->time, thread);
+	if (sample->raw_data)
+		process_raw_event(sample->raw_data, sample->cpu, sample->time,
+				  thread);

 	return 0;
 }
-- 
1.7.9.7

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

* Re: [PATCH] perf: fix perf-lock report coredump
  2012-07-11  1:06 [PATCH] perf: fix perf-lock report coredump Jovi Zhang
@ 2012-07-11  2:20 ` David Ahern
  2012-07-11  5:14   ` Jovi Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: David Ahern @ 2012-07-11  2:20 UTC (permalink / raw)
  To: Jovi Zhang
  Cc: Arnaldo Carvalho de Melo, Arnaldo Carvalho de Melo, Peter Zijlstra, LKML

On 7/10/12 7:06 PM, Jovi Zhang wrote:
>  From 4b363bf16c12b76788fbace1475123b7214ae58d Mon Sep 17 00:00:00 2001
> From: Jovi Zhang <bookjovi@gmail.com>
> Date: Wed, 11 Jul 2012 16:53:57 +0800
> Subject: [PATCH] perf: fix perf-lock report coredump
>
> Check sample type event raw_data is existed in perf.data firstly,
> then invoke process_raw_event, otherwise it will coredump.

Does this fix it for you:
http://lkml.org/lkml/2012/7/6/405

Also does 'perf lock record' work for you? If so can you send me your 
kernel config file?

Thanks,

David

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

* Re: [PATCH] perf: fix perf-lock report coredump
  2012-07-11  2:20 ` David Ahern
@ 2012-07-11  5:14   ` Jovi Zhang
  2012-07-12  3:49     ` David Ahern
  0 siblings, 1 reply; 4+ messages in thread
From: Jovi Zhang @ 2012-07-11  5:14 UTC (permalink / raw)
  To: David Ahern
  Cc: Arnaldo Carvalho de Melo, Arnaldo Carvalho de Melo, Peter Zijlstra, LKML

On Wed, Jul 11, 2012 at 10:20 AM, David Ahern <dsahern@gmail.com> wrote:
> On 7/10/12 7:06 PM, Jovi Zhang wrote:
>>
>>  From 4b363bf16c12b76788fbace1475123b7214ae58d Mon Sep 17 00:00:00 2001
>> From: Jovi Zhang <bookjovi@gmail.com>
>> Date: Wed, 11 Jul 2012 16:53:57 +0800
>> Subject: [PATCH] perf: fix perf-lock report coredump
>>
>> Check sample type event raw_data is existed in perf.data firstly,
>> then invoke process_raw_event, otherwise it will coredump.
>
>
> Does this fix it for you:
> http://lkml.org/lkml/2012/7/6/405
>
Yeah, same problem.
But the question is if there have some sample event with raw data in
perf.data, are we still just exit(1)?
or let perf-lock only report those sample events with raw data?

> Also does 'perf lock record' work for you? If so can you send me your kernel
> config file?
Not working. I assume LOCKDEP is not configured in my test machine.

>
> Thanks,
>
> David

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

* Re: [PATCH] perf: fix perf-lock report coredump
  2012-07-11  5:14   ` Jovi Zhang
@ 2012-07-12  3:49     ` David Ahern
  0 siblings, 0 replies; 4+ messages in thread
From: David Ahern @ 2012-07-12  3:49 UTC (permalink / raw)
  To: Jovi Zhang
  Cc: Arnaldo Carvalho de Melo, Arnaldo Carvalho de Melo, Peter Zijlstra, LKML

On 7/10/12 11:14 PM, Jovi Zhang wrote:
>> Does this fix it for you:
>> http://lkml.org/lkml/2012/7/6/405
>>
> Yeah, same problem.
> But the question is if there have some sample event with raw data in
> perf.data, are we still just exit(1)?
> or let perf-lock only report those sample events with raw data?

perf-lock uses 4 tracepoints. tracepoints add -R (raw data) to events. 
So, if the perf.data does not have tracepoints, there is no need for 
perf-lock info or report subcommands to proceed.

David

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

end of thread, other threads:[~2012-07-12  3:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-11  1:06 [PATCH] perf: fix perf-lock report coredump Jovi Zhang
2012-07-11  2:20 ` David Ahern
2012-07-11  5:14   ` Jovi Zhang
2012-07-12  3:49     ` David Ahern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.