Received: by 10.223.164.221 with SMTP id h29csp2462592wrb; Thu, 2 Nov 2017 11:18:15 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Q/sTCpVmnY6/npQEBOP2A3+pxwjYCW6HLXf8GPXue+iGAzSsKMTtR0+uZeZTxe2Ka370LL X-Received: by 10.84.163.75 with SMTP id n11mr4106598plg.287.1509646695314; Thu, 02 Nov 2017 11:18:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509646695; cv=none; d=google.com; s=arc-20160816; b=GaT+BTEWX1G7j2VA/m0+U8p7FtsuwdS04JhhmmamzM/H3/UwDlM+Pj/SBx+b2n4PDJ yiG82sscqAYn67eJeVkaZTLHBIe9Ekvl+OXUatAGyNKAX6DM7shUf8T0c6X/2uj2jlSe o+PifqiL57bkfBiRNN2jG/NhXSUj63rg/gPwGeJIaLr3hjGqJ4zqoDA28qSJUKg5Z2/5 b7o+BbfYpZcXQpLxjHQ45E1gKArAAhvSW7E84vVIVruPM85z8tcUVidX6qlRFLkTbTAH E4RDKYqh3zgr1g+yTraSgpR0GUp38ZjeVUtHVXXPYJScdnO2ZTpRaqdtV4cn/c6tEl4f rIvg== 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=MmLVRN6+R2F6Ufxs6G6KTBQhdmH6aE4eLlIC7aa97Aw=; b=zWPY36tI9jUpOBaxTacUYp9BWLYnyCp04pNRw0g7MNK2v057wSWtc6S4gGxRi/lr8l NgPeH/RT/E5+8j4N7153yt+7unZPl59ytRSDexDKvvuPMt8yx3rjoZ3PxuDZjLU9qqEz xHRhsFowse8uaLlfFR5T6ZkNWvJyTa8PQc/yjKMc1M5GYgULDot4qnv8LAur6IP5wkSx qTZZ1UEKxVW63dD5uAO2wQVjhd0UwNiMgVpQE4ttoKRVcFUvQTv+a+Rj0I7O1BoYHnrM CTKNLg3jnrnVLGpctPv3j4AxaN9mz8Lc9Nz4ewNpuTVREzfRz9cjFqSYT6vjpiNhRUNo JpZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Bwqq5MeI; 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.18.02; Thu, 02 Nov 2017 11:18:15 -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=Bwqq5MeI; 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 S934011AbdKBSQg (ORCPT + 97 others); Thu, 2 Nov 2017 14:16:36 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:55551 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932438AbdKBSQI (ORCPT ); Thu, 2 Nov 2017 14:16:08 -0400 Received: by mail-pg0-f68.google.com with SMTP id 15so294344pgc.12 for ; Thu, 02 Nov 2017 11:16:08 -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=MmLVRN6+R2F6Ufxs6G6KTBQhdmH6aE4eLlIC7aa97Aw=; b=Bwqq5MeIRGPf0T6vp+HoWcACFqSQFtNTSa3PkrNiYeH6SAtOec2ylUo8H191DbTNqA Furq9J8J3Uvyn0Z8l0OABJKmuwonVcFj3oJC6VIrH0qNHIdYL3bJJLapnQ/E9x8Si+NR luWvByrMjdMbc3lcCIIImZSyOQIl6Oxq6oU/a/353f31MC3Ihz8PKSpWEke7lToNYkfO dp8kLgVbma6VhrtJ6/2VrB8EwCy7RcQeWXFPWqbP6Q+DaysPFnpV2+9lOSPlRK5yRI3n tny5bYGJOsoooWxc2IJpVa3sx1CxkmqlXsJVxAcLRnJuyDOYgxf7sCe5daDGXwDh2oDu /lfA== 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=MmLVRN6+R2F6Ufxs6G6KTBQhdmH6aE4eLlIC7aa97Aw=; b=LO4qUn4EHANFA6IaA8y3s4huhmT4VjRD5qdQiI+GHZ6eOnxdqMW6wQ+hTV4jfhlqJ7 AaAmmlPvjXuKu8B1UBo7bNUG3Vj3Z05ODQTCauQcyAVLY6mHvJZfn7yFk3pVSN3JpoAK TRM9N4nwuyCRUZsH6/riUSnuQ3iRYx3fssQ/jQJ8Fz8HjrCDjYdYLjnY1oBrQeRwHw53 zzaxEOu4z6MtZR/2nlh3Wp9e4xrPMiQ42e5Lh0+vNArAPk33BQpq1HmMpyfHTf4zJbD3 alOCzKq3N8z8jovLf6PkATVoxEGNuBY6l+8ZVhIrobNuMycW2dDLv6jeJE4mgcVCZL4k QMHQ== X-Gm-Message-State: AMCzsaXl+FmI6qLZ3z3jwaQcaWvYwBx5EvLl3OnPIvs4NQAiNffa38uo 6a5hpa5szJoWfGV2dBCNvciMn7I7+N8= X-Received: by 10.159.195.7 with SMTP id bd7mr4187434plb.366.1509646567446; Thu, 02 Nov 2017 11:16:07 -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 a19sm7179546pfh.30.2017.11.02.11.16.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Nov 2017 11:16:06 -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 4/5] perf/record: add support for sampling skid ip Date: Thu, 2 Nov 2017 11:15:58 -0700 Message-Id: <1509646559-919-5-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 a new --skid-ip option to perf record to capture the unmodified interrupted instruction pointer in each sample. With this option, the kernel captures both the ip and skid ip. Unless precise mode is enabled both ip are the same. They may be different in precise mode depending on the event and precise sampling mode. $ perf record --skid-ip ..... Signed-off-by: Stephane Eranian --- tools/perf/Documentation/perf-record.txt | 8 ++++++++ tools/perf/builtin-record.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index 5a626ef666c2..1b2f37776d90 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt @@ -483,6 +483,14 @@ config terms. For example: 'cycles/overwrite/' and 'instructions/no-overwrite/'. Implies --tail-synthesize. +--skid-ip:: +Capture the unmodified interrupt instruction pointer (IP) in each sample. Usually +with event-based sampling, the ip has skid and rarely point to the instruction which +caused the event to overflow. On some architectures, the hardware can eliminate the +skid and perf_events returns it as the IP with precise sampling is enabled. But for +certain measurements, it may be useful to have both the correct and skid ip. This +option enable capturing the skid ip in additional to the corrected ip. Default: off + SEE ALSO -------- linkperf:perf-stat[1], linkperf:perf-list[1] diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index a6cbf1640269..d318c0721484 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -1585,6 +1585,8 @@ static struct option __record_options[] = { "signal"), OPT_BOOLEAN(0, "dry-run", &dry_run, "Parse options then exit"), + OPT_BOOLEAN(0, "skid-ip", &record.opts.skid_ip, + "capture skid ip in additional to ip"), OPT_END() }; -- 2.7.4 From 1583368317523042070@xxx Tue Nov 07 01:21:37 +0000 2017 X-GM-THRID: 1583368317523042070 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread