From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753668AbbG2IOY (ORCPT ); Wed, 29 Jul 2015 04:14:24 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56925 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753644AbbG2IOT (ORCPT ); Wed, 29 Jul 2015 04:14:19 -0400 Date: Wed, 29 Jul 2015 01:14:03 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: acme@redhat.com, linux-kernel@vger.kernel.org, eranian@google.com, namhyung@kernel.org, fweisbec@gmail.com, adrian.hunter@intel.com, hpa@zytor.com, jolsa@redhat.com, bp@suse.de, mingo@kernel.org, rostedt@goodmis.org, dsahern@gmail.com, tglx@linutronix.de Reply-To: eranian@google.com, linux-kernel@vger.kernel.org, acme@redhat.com, fweisbec@gmail.com, namhyung@kernel.org, hpa@zytor.com, adrian.hunter@intel.com, bp@suse.de, jolsa@redhat.com, rostedt@goodmis.org, mingo@kernel.org, dsahern@gmail.com, tglx@linutronix.de To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Stop copying kallsyms into the perf.data file header Git-Commit-ID: 6e5259e9b5b711b325a8455feb3ed27cdd0af0da 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: 6e5259e9b5b711b325a8455feb3ed27cdd0af0da Gitweb: http://git.kernel.org/tip/6e5259e9b5b711b325a8455feb3ed27cdd0af0da Author: Arnaldo Carvalho de Melo AuthorDate: Wed, 22 Jul 2015 17:02:18 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 23 Jul 2015 22:51:12 -0300 perf tools: Stop copying kallsyms into the perf.data file header Since we now ask libtraceevent, the only user of this payload, to use perf's symbol resolution routines, there is no need to carry about ~4.5MB per perf.data when we can get it from one of the places the perf symbol resolution looks for that symtab (debuginfo, ~/.debug/, /proc/kallsyms, --symfs, etc), using the kernel and modules build-ids to make sure the right table is used. Acked-by: David Ahern Cc: Adrian Hunter Cc: Borislav Petkov Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian Cc: Steven Rostedt Link: http://lkml.kernel.org/n/tip-h89ituf9rso2rv1v7kjrbeda@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/trace-event-info.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c index eb72716..2224598 100644 --- a/tools/perf/util/trace-event-info.c +++ b/tools/perf/util/trace-event-info.c @@ -341,20 +341,14 @@ out: static int record_proc_kallsyms(void) { - unsigned int size; - const char *path = "/proc/kallsyms"; - struct stat st; - int ret, err = 0; - - ret = stat(path, &st); - if (ret < 0) { - /* not found */ - size = 0; - if (write(output_fd, &size, 4) != 4) - err = -EIO; - return err; - } - return record_file(path, 4); + unsigned long long size = 0; + /* + * Just to keep older perf.data file parsers happy, record a zero + * sized kallsyms file, i.e. do the same thing that was done when + * /proc/kallsyms (or something specified via --kallsyms, in a + * different path) couldn't be read. + */ + return write(output_fd, &size, 4) != 4 ? -EIO : 0; } static int record_ftrace_printk(void)