From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965971AbdCXSsw (ORCPT ); Fri, 24 Mar 2017 14:48:52 -0400 Received: from terminus.zytor.com ([65.50.211.136]:55997 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965768AbdCXSsn (ORCPT ); Fri, 24 Mar 2017 14:48:43 -0400 Date: Fri, 24 Mar 2017 11:46:26 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: acme@redhat.com, jolsa@kernel.org, mingo@kernel.org, namhyung@kernel.org, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, wangnan0@huawei.com, adrian.hunter@intel.com, treeze.taeung@gmail.com, dsahern@gmail.com Reply-To: dsahern@gmail.com, treeze.taeung@gmail.com, wangnan0@huawei.com, adrian.hunter@intel.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, namhyung@kernel.org, jolsa@kernel.org, mingo@kernel.org, acme@redhat.com To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf annotate: Add comment clarifying how the source code line is parsed Git-Commit-ID: ed7b339fb570749042332169e62541b208fc4296 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: ed7b339fb570749042332169e62541b208fc4296 Gitweb: http://git.kernel.org/tip/ed7b339fb570749042332169e62541b208fc4296 Author: Arnaldo Carvalho de Melo AuthorDate: Tue, 21 Mar 2017 16:00:50 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 21 Mar 2017 16:00:50 -0300 perf annotate: Add comment clarifying how the source code line is parsed The source code line number (lineno) needs to be kept in accross calls to symbol__parse_objdump_line() when parsing the output of 'objdump -l -dS', so that it can associate it with the instructions till the next line. See disasm_line__new() and struct disasm_line::line_nr. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Taeung Song Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-7hpx8f8ybdpiujceysaj229w@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/annotate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 4d325cd..22cd1db 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -1482,6 +1482,12 @@ int symbol__disassemble(struct symbol *sym, struct map *map, const char *arch_na nline = 0; while (!feof(file)) { + /* + * The source code line number (lineno) needs to be kept in + * accross calls to symbol__parse_objdump_line(), so that it + * can associate it with the instructions till the next one. + * See disasm_line__new() and struct disasm_line::line_nr. + */ if (symbol__parse_objdump_line(sym, map, arch, file, privsize, &lineno) < 0) break;