Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1586075
| Path | csiph.com!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Namhyung Kim <namhyung@kernel.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/4] perf annotate: Align filename:linenr and more correct summary |
| Date | Wed, 22 Feb 2017 12:20:03 +0100 |
| Message-ID | <tdD7J-R8-25@gated-at.bofh.it> (permalink) |
| References | <tdC1X-8u2-3@gated-at.bofh.it> <tdC1X-8u2-9@gated-at.bofh.it> |
| X-Original-To | Taeung Song <treeze.taeung@gmail.com> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ZeDknb6aVvv8vM02wOqy7qXPT5Z1bLwC7U68+pkkKWo=; b=U9XSMbTUvi0Jj1zE9vznk/6uGhmjmMMIegCCLewvTMDA+pcP+qoMVl6DPlAyQaAlSB WSsE8R4Ffi7r4c+J0Wn8UPVuB6W/Kin6iIcVb4PKSQ5z7QMwxZFn4PvjfKwADqoea6rd 0bY1NGhSZz6mEQCepDws/7oBIKSUSPKEHCN+p6cLL+nkkPi1lzAEwXbrh5CINyp8dswZ G7oNXvBCJy/PeZ3sKMzOhcgKqQCLv5jibKz3Cf6akXmD9rmQgRa1w6DTETKFmROfAbP5 T7Q8Elmk4gCaPpwVcxnXS3WnV+oyqy/Y0Yjo3BYAuEn23ZfiRqNV5raWe3U0sibwz+6U TLhA== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ZeDknb6aVvv8vM02wOqy7qXPT5Z1bLwC7U68+pkkKWo=; b=HMb8boY1cakrAJpwGZ48wgXdRSf9cV/DvoGQIYOJ/I8hNs5YNbxt0ZeA7hpKCgGstk SBCOCexNmYMJKN3t3yIpgxfIwa2zRPHiLF0mMc0aibEcyV5e2KB59NOjUtGAtEsaUi2h depXF8q50IYq75Hltc1YtnNg9YXYqjCCsQqFn9ONR9FWY/UrDPniuQOQkuoCfXc3w8GA N+hbWbLEoj/1HbiHTMpXjkyB5Yimngm+bDoOGbb8LNxVEaihCgKLe2UGjA6Ar2pr4YKe CHOYvabOR7b8drAiybokH7K+UlA7ob2bMhKQqaROtmflh8/gAO8sawUrqReYgT+pV31/ 7tRw== |
| X-Gm-Message-State | AMke39ld+kdw6KRRI2uiWIdWvntCuQQHt7Ab5EtnlFsSHIAMfP5ZbLB2Bj7SOw4BZetelvzkbPvoxMUOpQblSA== |
| X-Received | by 10.28.147.147 with SMTP id v141mr2037982wmd.110.1487761985679; Wed, 22 Feb 2017 03:13:05 -0800 (PST) |
| MIME-Version | 1.0 |
| X-Google-Sender-Auth | vy3hYWWi_KhNjK2NhL8LNqJ1zNM |
| Content-Type | text/plain; charset=UTF-8 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 121 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Arnaldo Carvalho de Melo <acme@kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Jiri Olsa <jolsa@kernel.org>, Ingo Molnar <mingo@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Wang Nan <wangnan0@huawei.com>, Masami Hiramatsu <mhiramat@kernel.org>, Jiri Olsa <jolsa@redhat.com> |
| X-Original-Date | Wed, 22 Feb 2017 20:12:45 +0900 |
| X-Original-Message-ID | <CAM9d7cg6GYQBP=BqohOLw=0fXdG1BvL_Zok3zQy-7_b5_9LwyA@mail.gmail.com> |
| X-Original-References | <1487758103-7953-1-git-send-email-treeze.taeung@gmail.com> <1487758103-7953-3-git-send-email-treeze.taeung@gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1586075 |
Show key headers only | View raw
On Wed, Feb 22, 2017 at 7:08 PM, Taeung Song <treeze.taeung@gmail.com> wrote:
> In the stdio interface, currently 'filename:linenr' infos
> are confusedly printed in the intervals of assembly code.
> So fix it.
>
> The cause was a 0.5% filter of if statement. After fixed,
> additionally summary of overhead per srcline is more correct.
This patch does two things and fails to explain why.
Thanks,
Namhyung
>
> Before:
>
> # perf annotate --stdio -l
>
> Sorted summary for file /home/taeung/workspace/perf-test/test
> ----------------------------------------------
>
> 36.57 test.c:38
> 28.72 test.c:37
>
> ...
>
> Percent | Source code & Disassembly of test ...
>
> ...
>
> 0.21 : 400816: push %rbp
> test.c:26 1.86 : 400817: mov %rsp,%rbp
> 0.21 : 40081a: mov %edi,-0x24(%rbp)
> 0.21 : 40081d: mov %rsi,-0x30(%rbp)
>
> After:
>
> # perf annotate --stdio -l
>
> Sorted summary for file /home/taeung/workspace/perf-test/test
> ----------------------------------------------
>
> 37.40 test.c:38
> 29.34 test.c:37
>
> ...
>
> Percent | Source code & Disassembly of test ...
>
> ...
>
> test.c:26
> 0.21 : 400816: push %rbp
> 1.86 : 400817: mov %rsp,%rbp
> 0.21 : 40081a: mov %edi,-0x24(%rbp)
> 0.21 : 40081d: mov %rsi,-0x30(%rbp)
>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Jiri Olsa <jolsa@redhat.com>
> Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
> ---
> tools/perf/util/annotate.c | 17 ++---------------
> 1 file changed, 2 insertions(+), 15 deletions(-)
>
> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> index bc54e41..9d0aa50 100644
> --- a/tools/perf/util/annotate.c
> +++ b/tools/perf/util/annotate.c
> @@ -1002,7 +1002,6 @@ static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 st
> int max_lines, struct disasm_line *queue)
> {
> static const char *prev_line;
> - static const char *prev_color;
>
> if (dl->offset != -1) {
> const char *path = NULL;
> @@ -1059,17 +1058,10 @@ static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 st
>
> color = get_percent_color(max_percent);
>
> - /*
> - * Also color the filename and line if needed, with
> - * the same color than the percentage. Don't print it
> - * twice for close colored addr with the same filename:line
> - */
> if (path) {
> - if (!prev_line || strcmp(prev_line, path)
> - || color != prev_color) {
> - color_fprintf(stdout, color, " %s", path);
> + if (!prev_line || strcmp(prev_line, path)) {
> + fprintf(stdout, " %s\n", path);
> prev_line = path;
> - prev_color = color;
> }
> }
>
> @@ -1650,14 +1642,9 @@ static int symbol__get_source_line(struct symbol *sym, struct map *map,
> percent_max = src_line->samples[k].percent;
> }
>
> - if (percent_max <= 0.5)
> - goto next;
> -
> offset = start + i;
> src_line->path = get_srcline(map->dso, offset, NULL, false);
> insert_source_line(&tmp_root, src_line);
> -
> - next:
> src_line = (void *)src_line + sizeof_src_line;
> }
>
> --
> 2.7.4
>
--
Thanks,
Namhyung
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 2/4] perf annotate: Align filename:linenr and more correct summary Taeung Song <treeze.taeung@gmail.com> - 2017-02-22 11:10 +0100
Re: [PATCH 2/4] perf annotate: Align filename:linenr and more correct summary Namhyung Kim <namhyung@kernel.org> - 2017-02-22 12:20 +0100
Re: [PATCH 2/4] perf annotate: Align filename:linenr and more correct summary Namhyung Kim <namhyung@kernel.org> - 2017-02-22 12:30 +0100
Re: [PATCH 2/4] perf annotate: Align filename:linenr and more correct summary Taeung Song <treeze.taeung@gmail.com> - 2017-02-22 17:40 +0100
csiph-web