Received: by 10.223.164.221 with SMTP id h29csp2461392wrb; Thu, 2 Nov 2017 11:17:02 -0700 (PDT) X-Google-Smtp-Source: ABhQp+ThXm0X6B5Ndk2ZPENZjDDpuhVd7YIXv2puPFnEOGRt8unmovRxFSfCDX5EHSr+ll/3NFWB X-Received: by 10.84.163.75 with SMTP id n11mr4103098plg.287.1509646622143; Thu, 02 Nov 2017 11:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509646622; cv=none; d=google.com; s=arc-20160816; b=sxWuPhYOhmbc3W97yeNKzIePWFGwfNbF/D7FYa3xgNLvcn9jjBN+wYTmjNuN08bMlY oOk2E0uscTgajREumsJf9E2zTwBur1oK3PwhzONpPGJjvi6aWW/lu1dvP7u5jbp45flR +hpsN0xNN++n9fBIMX6a1QZJ2xJFOw1Le/Z6Xs737ms4yL+oI/P4S7sO8WEzJ4ITTS/y DcOP7CcLqu/Zl5V9BSEwRivKD3x8vlDAMPPMc2nt7n0E9JjTZ73+lioln7j+KwPSDgyQ 5XMaOtaycqtBPl+/HZo4kIckelveg5OX63lTTVl3EwXflkWFotsC/aL+0VpVOC35SIZQ uuJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=z5WeS/PtE+63GsbUxsn72tCO+DbUr/Rwf4PQ4kGypj4=; b=Fkc3hkiCbQs5pGvVzUx/nun1nVd2GIR5XRMcnvI09O4LT3bMHl34TdsQMAW0vWgBMW LD3KRM4B/9E3kDGk0iPSmRUHoYJCAW+nz5Hp0CT2P20mXk3cFUyKmvkTfrvDnWQALjLi wV/IU9IYHE5/kvqRT/ASvgeqIVCHhfyG70xE7r+BJ2fR04SIRhzcV35CUkeUkvdTVpOq hBKNvQRZ++TK3HN1y1LVG12EOVImuJ/NsJL3w2h12QXxLVaivNshszBlqQrcfZ5jH11A U/ZKKG84I9lcGDyUM2jwBtTGE6d7Blg/xIwNqb9h8a0DJRhfWI5SjucVJvp5i4Yh2RyC MKaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Ld5zN+68; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7si2691588plr.706.2017.11.02.11.16.48; Thu, 02 Nov 2017 11:17:02 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=Ld5zN+68; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933882AbdKBSQK (ORCPT + 97 others); Thu, 2 Nov 2017 14:16:10 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:49025 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933671AbdKBSQH (ORCPT ); Thu, 2 Nov 2017 14:16:07 -0400 Received: by mail-pg0-f65.google.com with SMTP id v78so313044pgb.5 for ; Thu, 02 Nov 2017 11:16:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=z5WeS/PtE+63GsbUxsn72tCO+DbUr/Rwf4PQ4kGypj4=; b=Ld5zN+68YoPZb7YaAKVknhW1jF9fqwmenfoiP06D2wK3hqgN+PoJkCXCaQyqwEPWTk Syux+VE+tci8jrR38l2w8IX1kdRkyPC7i74IV6gwoms9owl9zlmVcffM/Fkl+pKcas24 IbUK8zu4Ko2hlSzzY9BoyiXJh67EsN7Z9m6Ib+V91B3eGYE9FS3AO44FjVDAG8t7Vs5x HnuKQsrRjt03KJpERPjyaqZpRVff3fnVpA4eXk8ch/EGrDwni1DBE8vL5aWnYuY4Pwg0 KTX7yRt7S9Zlxekiub9s7HsgYqwnPdHCt4sjgOF6Ei5P5IDHI4uc1eMD8f0Eltd1BKiu rgOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z5WeS/PtE+63GsbUxsn72tCO+DbUr/Rwf4PQ4kGypj4=; b=RJe/OJfbl0coVkad2pVQWmC/mlhPRnwjKvvYhMOF4nZGbIw5SiZzkFBcm3lEjFpnAo 0/PzmX/IZoIfjxK5LUftcWI4Zh1W/CE/3v6R1UCFo2XE3GWl/QqN6NwjkD1mIv7TjAwX 45SeZehsFCk4rwCvysWSMSK9efpQTVAe+gmMocVN5ZKNBXrhawpCDYkSs4xhC7htbvLp v7f4iz3SlMWKF9aO7RMiukTN21sEHwm7vGiIuj92bCmsLMEFOyEfGrU9wpnSptaR6ZVM Z28Z7/DwYZPz44eGvuirmuKHQxCjExwMRq1ozVV69KTWDJRivdwAxy8h1eIXuF3qFgZc t2Kg== X-Gm-Message-State: AMCzsaWeNC8ct1nFkNp2GE8Fxw2815L607rMikkyCd3BbKNSlt03SNq5 Juwy+BJwF+EpmvTw9mphEXNEOH9KnF0= X-Received: by 10.99.1.81 with SMTP id 78mr4313297pgb.99.1509646565919; Thu, 02 Nov 2017 11:16:05 -0700 (PDT) Received: from localhost (c-67-169-55-77.hsd1.ca.comcast.net. [67.169.55.77]) by smtp.gmail.com with ESMTPSA id t18sm7767222pfi.98.2017.11.02.11.16.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Nov 2017 11:16:05 -0700 (PDT) From: Stephane Eranian To: linux-kernel@vger.kernel.org Cc: acme@redhat.com, peterz@infradead.org, mingo@elte.hu, ak@linux.intel.com, kan.liang@intel.com, jolsa@redhat.com Subject: [PATCH v2 3/5] perf/tools: add support for PERF_SAMPLE_SKID_IP Date: Thu, 2 Nov 2017 11:15:57 -0700 Message-Id: <1509646559-919-4-git-send-email-eranian@google.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509646559-919-1-git-send-email-eranian@google.com> References: <1509646559-919-1-git-send-email-eranian@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds the support code to handle the PERF_SAMPLE_SKID_IP record type. Signed-off-by: Stephane Eranian --- tools/include/uapi/linux/perf_event.h | 4 +++- tools/perf/perf.h | 1 + tools/perf/util/event.h | 1 + tools/perf/util/evsel.c | 10 ++++++++++ tools/perf/util/session.c | 3 +++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h index 140ae638cfd6..fd0f5111e433 100644 --- a/tools/include/uapi/linux/perf_event.h +++ b/tools/include/uapi/linux/perf_event.h @@ -140,8 +140,9 @@ enum perf_event_sample_format { PERF_SAMPLE_TRANSACTION = 1U << 17, PERF_SAMPLE_REGS_INTR = 1U << 18, PERF_SAMPLE_PHYS_ADDR = 1U << 19, + PERF_SAMPLE_SKID_IP = 1U << 20, - PERF_SAMPLE_MAX = 1U << 20, /* non-ABI */ + PERF_SAMPLE_MAX = 1U << 21, /* non-ABI */ }; /* @@ -816,6 +817,7 @@ enum perf_event_type { * { u64 abi; # enum perf_sample_regs_abi * u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_INTR * { u64 phys_addr;} && PERF_SAMPLE_PHYS_ADDR + * { u64 skid_ip; } && PERF_SAMPLE_SKID_IP * }; */ PERF_RECORD_SAMPLE = 9, diff --git a/tools/perf/perf.h b/tools/perf/perf.h index fbb0a9cd0ac6..b7637d6b34ec 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h @@ -59,6 +59,7 @@ struct record_opts { bool tail_synthesize; bool overwrite; bool ignore_missing_thread; + bool skid_ip; unsigned int freq; unsigned int mmap_pages; unsigned int auxtrace_mmap_pages; diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index d6cbb0a0d919..e4165e824fdf 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h @@ -201,6 +201,7 @@ struct perf_sample { u32 raw_size; u64 data_src; u64 phys_addr; + u64 skid_ip; u32 flags; u16 insn_len; u8 cpumode; diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index f894893c203d..08549bd92c05 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -980,6 +980,9 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts, if (opts->sample_weight) perf_evsel__set_sample_bit(evsel, WEIGHT); + if (opts->skid_ip) + perf_evsel__set_sample_bit(evsel, SKID_IP); + attr->task = track; attr->mmap = track; attr->mmap2 = track && !perf_missing_features.mmap2; @@ -1478,6 +1481,7 @@ static void __p_sample_type(char *buf, size_t size, u64 value) bit_name(BRANCH_STACK), bit_name(REGS_USER), bit_name(STACK_USER), bit_name(IDENTIFIER), bit_name(REGS_INTR), bit_name(DATA_SRC), bit_name(WEIGHT), bit_name(PHYS_ADDR), + bit_name(SKID_IP), { .name = NULL, } }; #undef bit_name @@ -2225,6 +2229,12 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event, array++; } + data->skid_ip = 0; + if (type & PERF_SAMPLE_SKID_IP) { + data->skid_ip = *array; + array++; + } + return 0; } diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index b3fd62f7e4c9..9390cedee6f4 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1130,6 +1130,9 @@ static void dump_sample(struct perf_evsel *evsel, union perf_event *event, if (sample_type & PERF_SAMPLE_READ) sample_read__printf(sample, evsel->attr.read_format); + + if (sample_type & PERF_SAMPLE_SKID_IP) + printf("... skid_ip: %" PRIu64 "\n", sample->skid_ip); } static void dump_read(struct perf_evsel *evsel, union perf_event *event) -- 2.7.4 From 1582965280004733410@xxx Thu Nov 02 14:35:31 +0000 2017 X-GM-THRID: 1582953512357690832 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread