Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753700AbbGQQ36 (ORCPT ); Fri, 17 Jul 2015 12:29:58 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:35142 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752300AbbGQQ34 convert rfc822-to-8bit (ORCPT ); Fri, 17 Jul 2015 12:29:56 -0400 Subject: Re: [PATCH 1/2] tracing: Fix function graph duration format for 7-digit number Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Jungseok Lee In-Reply-To: <20150716214436.741dff47@grimm.local.home> Date: Sat, 18 Jul 2015 01:29:51 +0900 Cc: mingo@redhat.com, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <92F7D51D-6477-408E-918D-D8CD80C47978@gmail.com> References: <1436626300-1679-1-git-send-email-jungseoklee85@gmail.com> <1436626300-1679-2-git-send-email-jungseoklee85@gmail.com> <20150716214436.741dff47@grimm.local.home> To: Steven Rostedt X-Mailer: Apple Mail (2.1283) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1880 Lines: 61 On Jul 17, 2015, at 10:44 AM, Steven Rostedt wrote: Hi, Steve Thanks for caring about this! > On Sat, 11 Jul 2015 14:51:39 +0000 > Jungseok Lee wrote: > >> diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c >> index 8968bf7..0bc16c4 100644 >> --- a/kernel/trace/trace_functions_graph.c >> +++ b/kernel/trace/trace_functions_graph.c >> @@ -716,6 +716,8 @@ trace_print_graph_duration(unsigned long long duration, struct trace_seq *s) >> snprintf(nsecs_str, slen, "%03lu", nsecs_rem); >> trace_seq_printf(s, ".%s", nsecs_str); >> len += strlen(nsecs_str); >> + } else if (len == 7) { >> + len -= 1; > > Don't you mean len--; You're right. >> } >> >> trace_seq_puts(s, " us "); > > I don't care much for an extra branch here. I'm going to go with the > following patch: > > -- Steve > > diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c > index 8968bf720c12..ca98445782ac 100644 > --- a/kernel/trace/trace_functions_graph.c > +++ b/kernel/trace/trace_functions_graph.c > @@ -715,13 +715,13 @@ trace_print_graph_duration(unsigned long long duration, struct trace_seq *s) > > snprintf(nsecs_str, slen, "%03lu", nsecs_rem); > trace_seq_printf(s, ".%s", nsecs_str); > - len += strlen(nsecs_str); > + len += strlen(nsecs_str) + 1; > } > > trace_seq_puts(s, " us "); > > /* Print remaining spaces to fit the row's width */ > - for (i = len; i < 7; i++) > + for (i = len; i < 8; i++) > trace_seq_putc(s, ' '); > } This change is better than my approach. As expected, it works well. Best Regards Jungseok Lee-- 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/