Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2306451imm; Thu, 7 Jun 2018 08:30:49 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLnsJhHFSyHAJnNMPFjL1XelTWrBGHT7y0zmCN0iE1NXqz+r0IrIdznvBw0XhKt+oSeHITo X-Received: by 2002:a17:902:5501:: with SMTP id f1-v6mr2554379pli.108.1528385449452; Thu, 07 Jun 2018 08:30:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528385449; cv=none; d=google.com; s=arc-20160816; b=B7ss/5Q6V0TZDNyb4yTkXTg0T77yYDl6JMUzsBU+EGMVcAiJMtHrhd4HJOsvA94rEX EGAQxdm2lK/++bUrOhZWz+S0b/+7Sva6jfMvrUKQupOMZ3qkn2/JTnOf5OCvogKN4kOf nhxqvLCETpCf/YrnS892F+xLnzv8pweLsueoW8H/vqy8kzw/G69f6Ob7z0NUth5pewkX Z9EHrw7GSSWaFd6VlmrBOZCPh4jpEm0kRk4/RAH/w5vhFkOQ5ZbBJx9IVAA2+8vyIv0q c1m4hFEDdDhKQJsQtjKgzhyjMMg+Dd4pR9UkKZMjUWpwmSksgFy8t92H4lDfTg0rTp5/ iciw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=E+RHAhi/mOth1gD+IBjjGs09CXtv2UvZFeXmvGil92s=; b=o/wSxFs2cG6t5+j3eMME9eWoSNBbovbfreiWxsgbnV+0B7m2GYxuuhRrEp4iLPAtHc BmQwnOG/jxSLcY6FY47PDVQqmzH2Pb5xffDPys2c/AEJ5Xt0LXFEWTBAs+vdLKFTB6wL XZ6ASRq4UG4MI2SwOgfhoCQ3LhP/GCHs8yFGntte8yfg2ojxAhePYGYEndlomzihHvTH 0uejcHmyolshxee2sWZvGLWMpuqyHoPq2M9NKRiBNv4AecsF0yGDbayq7uutiUit2yXt wryV/69wiVnusWjM2g7mERelnpdenbt2H1RqPm3qcd4tJdFpp93TwgIu8v+5Dh7fpRAR mNBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11-v6si379641pgp.95.2018.06.07.08.30.34; Thu, 07 Jun 2018 08:30:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935428AbeFGOzB (ORCPT + 99 others); Thu, 7 Jun 2018 10:55:01 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:41026 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935394AbeFGOy5 (ORCPT ); Thu, 7 Jun 2018 10:54:57 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbv-0005hL-BA; Thu, 07 Jun 2018 15:09:55 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvaz-0002lf-VP; Thu, 07 Jun 2018 15:08:57 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Arnaldo Carvalho de Melo" , "Adrian Hunter" , "Wang Nan" , "Jiri Olsa" , "Namhyung Kim" , "David Ahern" , "Thomas Gleixner" , "Andi Kleen" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 069/410] perf report: Fix -D output for user metadata events In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Arnaldo Carvalho de Melo commit f250b09c779550e4a7a412dae6d3ad34d5201019 upstream. The PERF_RECORD_USER_ events are synthesized by the tool to assist in processing the PERF_RECORD_ ones generated by the kernel, the printing of that information doesn't come with a perf_sample structure, so, when dumping the event fields using 'perf report -D' there were columns that end up not being printed. To tidy up a bit this, fake a perf_sample structure with zeroes to have the missing columns printed and avoid the occasional surprise with that. Before: 0 0x45b8 [0x68]: PERF_RECORD_MMAP -1/0: [0xffffffffc12ec000(0x4000) @ 0]: x /lib/modules/4.14.0+/kernel/fs/nls/nls_utf8.ko 0x4620 [0x28]: PERF_RECORD_THREAD_MAP nr: 1 thread: 27820 0x4648 [0x18]: PERF_RECORD_CPU_MAP: 0-3 0 0x4660 [0x28]: PERF_RECORD_COMM: perf:27820/27820 0x4a58 [0x8]: PERF_RECORD_FINISHED_ROUND 447723433020976 0x4688 [0x28]: PERF_RECORD_SAMPLE(IP, 0x4001): 27820/27820: 0xffffffff8f1b6d7a period: 1 addr: 0 After: $ perf report -D | grep PERF_RECORD_ | head 0 0xe8 [0x20]: PERF_RECORD_TIME_CONV: unhandled! 0 0x108 [0x28]: PERF_RECORD_THREAD_MAP nr: 1 thread: 32555 0 0x130 [0x18]: PERF_RECORD_CPU_MAP: 0-3 0 0x148 [0x28]: PERF_RECORD_COMM: perf:32555/32555 0 0x4e8 [0x8]: PERF_RECORD_FINISHED_ROUND 448743409421205 0x170 [0x28]: PERF_RECORD_COMM exec: sleep:32555/32555 448743409431883 0x198 [0x68]: PERF_RECORD_MMAP2 32555/32555: [0x55e11d75a000(0x208000) @ 0 fd:00 3147174 2566255743]: r-xp /usr/bin/sleep 448743409443873 0x200 [0x70]: PERF_RECORD_MMAP2 32555/32555: [0x7f0ced316000(0x229000) @ 0 fd:00 3151761 2566238119]: r-xp /usr/lib64/ld-2.25.so 448743409454790 0x270 [0x60]: PERF_RECORD_MMAP2 32555/32555: [0x7ffe84f6d000(0x2000) @ 0 00:00 0 0]: r-xp [vdso] 448743409479500 0x2d0 [0x28]: PERF_RECORD_SAMPLE(IP, 0x4002): 32555/32555: 0xffffffff8f84c7e7 period: 1 addr: 0 $ Cc: Adrian Hunter Cc: Andi Kleen Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Cc: Thomas Gleixner Fixes: 9aefcab0de47 ("perf session: Consolidate the dump code") Link: https://lkml.kernel.org/n/tip-todcu15x0cwgppkh1gi6uhru@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- tools/perf/util/session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -996,10 +996,11 @@ static int perf_session_deliver_event(st static int perf_session__process_user_event(struct perf_session *session, union perf_event *event, struct perf_tool *tool, u64 file_offset) { + struct perf_sample sample = { .time = 0, }; int fd = perf_data_file__fd(session->file); int err; - dump_event(session, event, file_offset, NULL); + dump_event(session, event, file_offset, &sample); /* These events are processed right away */ switch (event->header.type) {