All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -tip] ftrace: Fix outputting formats of x86-tsc and counter when use trace_clock
@ 2013-04-23  1:32 Yoshihiro YUNOMAE
  2013-05-07  2:18 ` Yoshihiro YUNOMAE
  0 siblings, 1 reply; 4+ messages in thread
From: Yoshihiro YUNOMAE @ 2013-04-23  1:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Frederic Weisbecker, Steven Rostedt, Hidehiro Kawai, Ingo Molnar,
	yrl.pp-manager.tt, Masami Hiramatsu

Outputting formats of x86-tsc and counter should be a raw format, but after
applying the patch(2b6080f28c7cc3efc8625ab71495aae89aeb63a0), the format was
changed to nanosec. This is because the global variable trace_clock_id was used.
When we use multiple buffers, clock_id of each sub-buffer should be used. Then,
this patch uses tr->clock_id instead of the global variable trace_clock_id.

Signed-off-by: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
---
 kernel/trace/trace.c |    8 +++-----
 kernel/trace/trace.h |    2 --
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 7297079..2ab9ccb 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -652,8 +652,6 @@ static struct {
 	ARCH_TRACE_CLOCKS
 };
 
-int trace_clock_id;
-
 /*
  * trace_parser_get_init - gets the buffer for trace parser
  */
@@ -2815,7 +2813,7 @@ __tracing_open(struct inode *inode, struct file *file, bool snapshot)
 		iter->iter_flags |= TRACE_FILE_ANNOTATE;
 
 	/* Output in nanoseconds only if we are using a clock in nanoseconds. */
-	if (trace_clocks[trace_clock_id].in_ns)
+	if (trace_clocks[tr->clock_id].in_ns)
 		iter->iter_flags |= TRACE_FILE_TIME_IN_NS;
 
 	/* stop the trace while dumping if we are not opening "snapshot" */
@@ -3814,7 +3812,7 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp)
 		iter->iter_flags |= TRACE_FILE_LAT_FMT;
 
 	/* Output in nanoseconds only if we are using a clock in nanoseconds. */
-	if (trace_clocks[trace_clock_id].in_ns)
+	if (trace_clocks[tr->clock_id].in_ns)
 		iter->iter_flags |= TRACE_FILE_TIME_IN_NS;
 
 	iter->cpu_file = tc->cpu;
@@ -5084,7 +5082,7 @@ tracing_stats_read(struct file *filp, char __user *ubuf,
 	cnt = ring_buffer_bytes_cpu(trace_buf->buffer, cpu);
 	trace_seq_printf(s, "bytes: %ld\n", cnt);
 
-	if (trace_clocks[trace_clock_id].in_ns) {
+	if (trace_clocks[tr->clock_id].in_ns) {
 		/* local or global for trace_clock */
 		t = ns2usecs(ring_buffer_oldest_event_ts(trace_buf->buffer, cpu));
 		usec_rem = do_div(t, USEC_PER_SEC);
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 9e01458..0ae9e8a 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -705,8 +705,6 @@ enum print_line_t print_trace_line(struct trace_iterator *iter);
 
 extern unsigned long trace_flags;
 
-extern int trace_clock_id;
-
 /* Standard output formatting function used for function return traces */
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 


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

* Re: [PATCH -tip] ftrace: Fix outputting formats of x86-tsc and counter when use trace_clock
  2013-04-23  1:32 [PATCH -tip] ftrace: Fix outputting formats of x86-tsc and counter when use trace_clock Yoshihiro YUNOMAE
@ 2013-05-07  2:18 ` Yoshihiro YUNOMAE
  2013-06-11  0:44   ` Yoshihiro YUNOMAE
  0 siblings, 1 reply; 4+ messages in thread
From: Yoshihiro YUNOMAE @ 2013-05-07  2:18 UTC (permalink / raw)
  To: Frederic Weisbecker, Steven Rostedt, Ingo Molnar
  Cc: linux-kernel, Hidehiro Kawai, yrl.pp-manager.tt, Masami Hiramatsu

Hi,

Would you apply this patch for the tip tree?

Thanks,
Yoshihiro YUNOMAE

(2013/04/23 10:32), Yoshihiro YUNOMAE wrote:
> Outputting formats of x86-tsc and counter should be a raw format, but after
> applying the patch(2b6080f28c7cc3efc8625ab71495aae89aeb63a0), the format was
> changed to nanosec. This is because the global variable trace_clock_id was used.
> When we use multiple buffers, clock_id of each sub-buffer should be used. Then,
> this patch uses tr->clock_id instead of the global variable trace_clock_id.
>
> Signed-off-by: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> ---
>   kernel/trace/trace.c |    8 +++-----
>   kernel/trace/trace.h |    2 --
>   2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 7297079..2ab9ccb 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -652,8 +652,6 @@ static struct {
>   	ARCH_TRACE_CLOCKS
>   };
>
> -int trace_clock_id;
> -
>   /*
>    * trace_parser_get_init - gets the buffer for trace parser
>    */
> @@ -2815,7 +2813,7 @@ __tracing_open(struct inode *inode, struct file *file, bool snapshot)
>   		iter->iter_flags |= TRACE_FILE_ANNOTATE;
>
>   	/* Output in nanoseconds only if we are using a clock in nanoseconds. */
> -	if (trace_clocks[trace_clock_id].in_ns)
> +	if (trace_clocks[tr->clock_id].in_ns)
>   		iter->iter_flags |= TRACE_FILE_TIME_IN_NS;
>
>   	/* stop the trace while dumping if we are not opening "snapshot" */
> @@ -3814,7 +3812,7 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp)
>   		iter->iter_flags |= TRACE_FILE_LAT_FMT;
>
>   	/* Output in nanoseconds only if we are using a clock in nanoseconds. */
> -	if (trace_clocks[trace_clock_id].in_ns)
> +	if (trace_clocks[tr->clock_id].in_ns)
>   		iter->iter_flags |= TRACE_FILE_TIME_IN_NS;
>
>   	iter->cpu_file = tc->cpu;
> @@ -5084,7 +5082,7 @@ tracing_stats_read(struct file *filp, char __user *ubuf,
>   	cnt = ring_buffer_bytes_cpu(trace_buf->buffer, cpu);
>   	trace_seq_printf(s, "bytes: %ld\n", cnt);
>
> -	if (trace_clocks[trace_clock_id].in_ns) {
> +	if (trace_clocks[tr->clock_id].in_ns) {
>   		/* local or global for trace_clock */
>   		t = ns2usecs(ring_buffer_oldest_event_ts(trace_buf->buffer, cpu));
>   		usec_rem = do_div(t, USEC_PER_SEC);
> diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
> index 9e01458..0ae9e8a 100644
> --- a/kernel/trace/trace.h
> +++ b/kernel/trace/trace.h
> @@ -705,8 +705,6 @@ enum print_line_t print_trace_line(struct trace_iterator *iter);
>
>   extern unsigned long trace_flags;
>
> -extern int trace_clock_id;
> -
>   /* Standard output formatting function used for function return traces */
>   #ifdef CONFIG_FUNCTION_GRAPH_TRACER
>
>
> --
> 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/
>

-- 
Yoshihiro YUNOMAE
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: yoshihiro.yunomae.ez@hitachi.com



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

* Re: Re: [PATCH -tip] ftrace: Fix outputting formats of x86-tsc and counter when use trace_clock
  2013-05-07  2:18 ` Yoshihiro YUNOMAE
@ 2013-06-11  0:44   ` Yoshihiro YUNOMAE
  2013-06-11  1:12     ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Yoshihiro YUNOMAE @ 2013-06-11  0:44 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Frederic Weisbecker, Ingo Molnar, linux-kernel, Hidehiro Kawai,
	yrl.pp-manager.tt, Masami Hiramatsu

Hi Steven,

Would you review this bugfix patch?

Thanks,
Yoshihiro YUNOMAE

(2013/05/07 11:18), Yoshihiro YUNOMAE wrote:
> Hi,
>
> Would you apply this patch for the tip tree?
>
> Thanks,
> Yoshihiro YUNOMAE
>
> (2013/04/23 10:32), Yoshihiro YUNOMAE wrote:
>> Outputting formats of x86-tsc and counter should be a raw format, but
>> after
>> applying the patch(2b6080f28c7cc3efc8625ab71495aae89aeb63a0), the
>> format was
>> changed to nanosec. This is because the global variable trace_clock_id
>> was used.
>> When we use multiple buffers, clock_id of each sub-buffer should be
>> used. Then,
>> this patch uses tr->clock_id instead of the global variable
>> trace_clock_id.
>>
>> Signed-off-by: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
>> Cc: Steven Rostedt <rostedt@goodmis.org>
>> Cc: Frederic Weisbecker <fweisbec@gmail.com>
>> Cc: Ingo Molnar <mingo@redhat.com>
>> ---
>>   kernel/trace/trace.c |    8 +++-----
>>   kernel/trace/trace.h |    2 --
>>   2 files changed, 3 insertions(+), 7 deletions(-)
>>
>> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
>> index 7297079..2ab9ccb 100644
>> --- a/kernel/trace/trace.c
>> +++ b/kernel/trace/trace.c
>> @@ -652,8 +652,6 @@ static struct {
>>       ARCH_TRACE_CLOCKS
>>   };
>>
>> -int trace_clock_id;
>> -
>>   /*
>>    * trace_parser_get_init - gets the buffer for trace parser
>>    */
>> @@ -2815,7 +2813,7 @@ __tracing_open(struct inode *inode, struct file
>> *file, bool snapshot)
>>           iter->iter_flags |= TRACE_FILE_ANNOTATE;
>>
>>       /* Output in nanoseconds only if we are using a clock in
>> nanoseconds. */
>> -    if (trace_clocks[trace_clock_id].in_ns)
>> +    if (trace_clocks[tr->clock_id].in_ns)
>>           iter->iter_flags |= TRACE_FILE_TIME_IN_NS;
>>
>>       /* stop the trace while dumping if we are not opening "snapshot" */
>> @@ -3814,7 +3812,7 @@ static int tracing_open_pipe(struct inode
>> *inode, struct file *filp)
>>           iter->iter_flags |= TRACE_FILE_LAT_FMT;
>>
>>       /* Output in nanoseconds only if we are using a clock in
>> nanoseconds. */
>> -    if (trace_clocks[trace_clock_id].in_ns)
>> +    if (trace_clocks[tr->clock_id].in_ns)
>>           iter->iter_flags |= TRACE_FILE_TIME_IN_NS;
>>
>>       iter->cpu_file = tc->cpu;
>> @@ -5084,7 +5082,7 @@ tracing_stats_read(struct file *filp, char
>> __user *ubuf,
>>       cnt = ring_buffer_bytes_cpu(trace_buf->buffer, cpu);
>>       trace_seq_printf(s, "bytes: %ld\n", cnt);
>>
>> -    if (trace_clocks[trace_clock_id].in_ns) {
>> +    if (trace_clocks[tr->clock_id].in_ns) {
>>           /* local or global for trace_clock */
>>           t = ns2usecs(ring_buffer_oldest_event_ts(trace_buf->buffer,
>> cpu));
>>           usec_rem = do_div(t, USEC_PER_SEC);
>> diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
>> index 9e01458..0ae9e8a 100644
>> --- a/kernel/trace/trace.h
>> +++ b/kernel/trace/trace.h
>> @@ -705,8 +705,6 @@ enum print_line_t print_trace_line(struct
>> trace_iterator *iter);
>>
>>   extern unsigned long trace_flags;
>>
>> -extern int trace_clock_id;
>> -
>>   /* Standard output formatting function used for function return
>> traces */
>>   #ifdef CONFIG_FUNCTION_GRAPH_TRACER
>>
>>
>> --
>> 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/
>>
>

-- 
Yoshihiro YUNOMAE
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: yoshihiro.yunomae.ez@hitachi.com



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

* Re: Re: [PATCH -tip] ftrace: Fix outputting formats of x86-tsc and counter when use trace_clock
  2013-06-11  0:44   ` Yoshihiro YUNOMAE
@ 2013-06-11  1:12     ` Steven Rostedt
  0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2013-06-11  1:12 UTC (permalink / raw)
  To: Yoshihiro YUNOMAE
  Cc: Frederic Weisbecker, Ingo Molnar, linux-kernel, Hidehiro Kawai,
	yrl.pp-manager.tt, Masami Hiramatsu

On Tue, 2013-06-11 at 09:44 +0900, Yoshihiro YUNOMAE wrote:
> Hi Steven,
> 
> Would you review this bugfix patch?

Ah, thanks for the reminder. This got pushed down on my todo list. I'll
take a look at it tonight.

-- Steve

> 
> Thanks,
> Yoshihiro YUNOMAE
> 



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

end of thread, other threads:[~2013-06-11  1:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-23  1:32 [PATCH -tip] ftrace: Fix outputting formats of x86-tsc and counter when use trace_clock Yoshihiro YUNOMAE
2013-05-07  2:18 ` Yoshihiro YUNOMAE
2013-06-11  0:44   ` Yoshihiro YUNOMAE
2013-06-11  1:12     ` Steven Rostedt

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.