From patchwork Thu Feb 8 11:31:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 198324 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp100399dyd; Thu, 8 Feb 2024 03:34:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IHlLHiPXlTPSfVZz8zJNyd6HJ+Wa3X3fJEwAEbUNsOEMiFp6iHXt+CkwWP4mgqHlGYI+FTm X-Received: by 2002:a5b:88d:0:b0:dc6:bcb3:5d8e with SMTP id e13-20020a5b088d000000b00dc6bcb35d8emr7470014ybq.20.1707392072067; Thu, 08 Feb 2024 03:34:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707392072; cv=pass; d=google.com; s=arc-20160816; b=fKfNmYFO9AWTHSy6Y7Rmf3jd2tl5X3+yNnC9SHgPCvM+/9PNtKcPy2HcXMnaqzWRpJ KxtAXXlFynmp10I871Equo8rSlwRFZFivfuyJhVvxdWfJTnHW5icDZxLP5iL2a1TUixk QaeWTqhjb6ucYLRnVPLuSOKZC7cgVDC8B4+rBSZVr0eUWPu3JZi/adkO2vOV8AVEu1zh TDiI0b4iFz0PQHte4EBEl7tSTS3jKaON8FrSmwBSR2e8QoszJW41rRxaZxUdFun6uxHj CoHgKd/UPDNgz5CLMFs57O/+4ezRkEhDG+vjIWvo6CxzVpBFi0zBKb7bLpmgyzLXdPZU 4DpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:organization:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=C3RK26A2uo6dD/WWl+VjFqDA8GjhhVN/bKwt+YViyoE=; fh=zDU0K0/TGGlqaAqBfI0TXwvLxX/YCc0rzrvB0/oIgR8=; b=UTvJFYPr0i8FaDXiNkBqxOd7o8EZ88DUlAGeewXnARHJAuZQwXhUX1wa5oCfX2mLtj lMca5USSIxi6gcFHO8m5fYWDH42WJstZlDvBhM48gHoLuiFskAGE6zWPQ5/2RCXvXUY/ 5PcfbALqlfpV2KkITn6Ym8YOdtK4iedsnknsf2aAKmIwfYXIU2sOYifjd1C03Zaw1L71 +I2IQMM7IoCxlFvKFoE6fZcc5UY2Kj93e9PbNpE0t5CD38c8syoLSaod7zli/uLKfBDD Jwgi0fE40aOQSYSLlghpoQVbPkyxPem2OyiLjZ/C3175iUzKGly8a1uBKxEGmgqTuBsU u6FA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MmnieKV4; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57967-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57967-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCWVcs5+dhB7NbK7fG9Y46yMmKY9/JkPMlgeshLiTYYcA6de6vjUYoMId+dMlZ2eFFqEd+DftjkaYqi6jesB/4ibhr0t9w== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h14-20020a0cf8ce000000b0068c4530beffsi2944816qvo.353.2024.02.08.03.34.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 03:34:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57967-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MmnieKV4; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57967-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57967-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C42F01C2135A for ; Thu, 8 Feb 2024 11:34:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87C9C763F7; Thu, 8 Feb 2024 11:32:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MmnieKV4" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 945BB763E7; Thu, 8 Feb 2024 11:32:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707391948; cv=none; b=SqQuiIEuAmUzNUPNFjiXne/mLa+0Q+AzOYOvDjR4iQ7dvYkSRYcP/JHX5a4gTKWCWAPKqL/limFAlmw6LS/Cr69zCiZ9fGIlnSQYyuMysY/7NczgR2+/2/N3ncBY/OljUNBFnYR1qehkM84tvLgLPpm701zpIfjPZwSezthBh3c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707391948; c=relaxed/simple; bh=AKPcWBzNqSLXpi+HJcYIiU5xlui38B0/DvWSJcjZ7S8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aK+wh9dziHqNduIkIjb1+Xutb5LTQlcPQy88Dsc2xE0qmMTs7P9ypoNlJKC5uRiLFR/VEDNz2AQPMEh/DnpZwLVIjTb1DKey3B6sdPgjtJ963vE5UHu/PaalWSYgeDSw8WjFWnOfwI6xsPybIG/SJhv+uJJXw8/NWEudylgUpbE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=MmnieKV4; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707391947; x=1738927947; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AKPcWBzNqSLXpi+HJcYIiU5xlui38B0/DvWSJcjZ7S8=; b=MmnieKV48ru+Ak6E6NKRmAJ43HlKVvKyGb93a5711VCGot/HIhnjPw3S Jgg2a0JphW8ysrJ0jgEcoXYOOVYsetyJGzhHVn/vam35BpIPXxufikAOv yQGOoTzWMUFI99Jj2UxreQDEvHAiVpqnG0V5c1hhiujNWajfKlbJyjOGt Pmtj6wdHsoIl3/k62KcH6n3CSqrgaH17nvIHr/PUNi5KcsTrqjA6MH2fn PyF0N/do4ephCQQFAG2Y5rQEVT6sdhi3o85jkearkpbxlRlGIj+5k9eeq kS6eutS1sGja9+P18DfSYBWuAz6NSFGY7K7KC3OGQS7rVIuy1VvI/9kEA g==; X-IronPort-AV: E=McAfee;i="6600,9927,10977"; a="1345650" X-IronPort-AV: E=Sophos;i="6.05,253,1701158400"; d="scan'208";a="1345650" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 03:32:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,253,1701158400"; d="scan'208";a="1957636" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.251.219.88]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 03:32:20 -0800 From: Adrian Hunter To: Peter Zijlstra Cc: Ingo Molnar , Mark Rutland , Alexander Shishkin , Heiko Carstens , Thomas Richter , Hendrik Brueckner , Suzuki K Poulose , Mike Leach , James Clark , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, Yicong Yang , Jonathan Cameron , Will Deacon , Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Ian Rogers , Andi Kleen , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH V5 07/12] perf tools: Add aux-action config term Date: Thu, 8 Feb 2024 13:31:22 +0200 Message-Id: <20240208113127.22216-8-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240208113127.22216-1-adrian.hunter@intel.com> References: <20240208113127.22216-1-adrian.hunter@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790330349411228902 X-GMAIL-MSGID: 1790330349411228902 Add a new common config term "aux-action" to use for configuring AUX area trace pause / resume. The value is a string that will be parsed in a subsequent patch. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers --- tools/perf/util/evsel.c | 2 ++ tools/perf/util/evsel_config.h | 1 + tools/perf/util/parse-events.c | 10 ++++++++++ tools/perf/util/parse-events.h | 1 + tools/perf/util/parse-events.l | 1 + 5 files changed, 15 insertions(+) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 3536404e9447..866c69f83595 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1001,6 +1001,8 @@ static void evsel__apply_config_terms(struct evsel *evsel, case EVSEL__CONFIG_TERM_AUX_OUTPUT: attr->aux_output = term->val.aux_output ? 1 : 0; break; + case EVSEL__CONFIG_TERM_AUX_ACTION: + break; case EVSEL__CONFIG_TERM_AUX_SAMPLE_SIZE: /* Already applied by auxtrace */ break; diff --git a/tools/perf/util/evsel_config.h b/tools/perf/util/evsel_config.h index aee6f808b512..af52a1516d0b 100644 --- a/tools/perf/util/evsel_config.h +++ b/tools/perf/util/evsel_config.h @@ -25,6 +25,7 @@ enum evsel_term_type { EVSEL__CONFIG_TERM_BRANCH, EVSEL__CONFIG_TERM_PERCORE, EVSEL__CONFIG_TERM_AUX_OUTPUT, + EVSEL__CONFIG_TERM_AUX_ACTION, EVSEL__CONFIG_TERM_AUX_SAMPLE_SIZE, EVSEL__CONFIG_TERM_CFG_CHG, }; diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 6f8b0fa17689..75ebc515faba 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -768,6 +768,7 @@ static const char *config_term_name(enum parse_events__term_type term_type) [PARSE_EVENTS__TERM_TYPE_DRV_CFG] = "driver-config", [PARSE_EVENTS__TERM_TYPE_PERCORE] = "percore", [PARSE_EVENTS__TERM_TYPE_AUX_OUTPUT] = "aux-output", + [PARSE_EVENTS__TERM_TYPE_AUX_ACTION] = "aux-action", [PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE] = "aux-sample-size", [PARSE_EVENTS__TERM_TYPE_METRIC_ID] = "metric-id", [PARSE_EVENTS__TERM_TYPE_RAW] = "raw", @@ -817,6 +818,7 @@ config_term_avail(enum parse_events__term_type term_type, struct parse_events_er case PARSE_EVENTS__TERM_TYPE_OVERWRITE: case PARSE_EVENTS__TERM_TYPE_DRV_CFG: case PARSE_EVENTS__TERM_TYPE_AUX_OUTPUT: + case PARSE_EVENTS__TERM_TYPE_AUX_ACTION: case PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE: case PARSE_EVENTS__TERM_TYPE_RAW: case PARSE_EVENTS__TERM_TYPE_LEGACY_CACHE: @@ -936,6 +938,9 @@ do { \ case PARSE_EVENTS__TERM_TYPE_AUX_OUTPUT: CHECK_TYPE_VAL(NUM); break; + case PARSE_EVENTS__TERM_TYPE_AUX_ACTION: + CHECK_TYPE_VAL(STR); + break; case PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE: CHECK_TYPE_VAL(NUM); if (term->val.num > UINT_MAX) { @@ -1053,6 +1058,7 @@ static int config_term_tracepoint(struct perf_event_attr *attr, case PARSE_EVENTS__TERM_TYPE_OVERWRITE: case PARSE_EVENTS__TERM_TYPE_NOOVERWRITE: case PARSE_EVENTS__TERM_TYPE_AUX_OUTPUT: + case PARSE_EVENTS__TERM_TYPE_AUX_ACTION: case PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE: return config_term_common(attr, term, err); case PARSE_EVENTS__TERM_TYPE_USER: @@ -1187,6 +1193,9 @@ do { \ ADD_CONFIG_TERM_VAL(AUX_OUTPUT, aux_output, term->val.num ? 1 : 0, term->weak); break; + case PARSE_EVENTS__TERM_TYPE_AUX_ACTION: + ADD_CONFIG_TERM_STR(AUX_ACTION, term->val.str, term->weak); + break; case PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE: ADD_CONFIG_TERM_VAL(AUX_SAMPLE_SIZE, aux_sample_size, term->val.num, term->weak); @@ -1249,6 +1258,7 @@ static int get_config_chgs(struct perf_pmu *pmu, struct parse_events_terms *head case PARSE_EVENTS__TERM_TYPE_DRV_CFG: case PARSE_EVENTS__TERM_TYPE_PERCORE: case PARSE_EVENTS__TERM_TYPE_AUX_OUTPUT: + case PARSE_EVENTS__TERM_TYPE_AUX_ACTION: case PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE: case PARSE_EVENTS__TERM_TYPE_METRIC_ID: case PARSE_EVENTS__TERM_TYPE_RAW: diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index 809359e8544e..7e467ff71f19 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h @@ -74,6 +74,7 @@ enum parse_events__term_type { PARSE_EVENTS__TERM_TYPE_DRV_CFG, PARSE_EVENTS__TERM_TYPE_PERCORE, PARSE_EVENTS__TERM_TYPE_AUX_OUTPUT, + PARSE_EVENTS__TERM_TYPE_AUX_ACTION, PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE, PARSE_EVENTS__TERM_TYPE_METRIC_ID, PARSE_EVENTS__TERM_TYPE_RAW, diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l index e86c45675e1d..26a60ad5853c 100644 --- a/tools/perf/util/parse-events.l +++ b/tools/perf/util/parse-events.l @@ -244,6 +244,7 @@ overwrite { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_OVERWRITE); } no-overwrite { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_NOOVERWRITE); } percore { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_PERCORE); } aux-output { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_AUX_OUTPUT); } +aux-action { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_AUX_ACTION); } aux-sample-size { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE); } metric-id { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_METRIC_ID); } cpu-cycles|cycles { return hw_term(yyscanner, PERF_COUNT_HW_CPU_CYCLES); }