From nobody Wed Dec 17 12:06:29 2025 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C04D190692 for ; Tue, 18 Mar 2025 04:14:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742271293; cv=none; b=efyRQEh0OANvoLilyD0uP366p9YGxmCMRJopqHcx8EMx0ifbrHjE8Qnrn9JKmw7yvi7iz8dLgQ5hfC9bek8E0Un68sxh0OP9SsLlJil+Vc8FOu1FIKAj2bx+v03Bx7VD2CAzOlhe6s0IVsvKf3sjGFQ3kvDvvxE44Mo7+/9KX5c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742271293; c=relaxed/simple; bh=l1jkTLgRI/f5/qN6LeVtV033c5ilO6kZMs//pmDP2rQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=QWuGc2mhl5WY0DqtQcW0VyU8M9M9jVonMEKbM4CVOGq66olcJ055X6W3CtQAgG7Ixv2vbGRBZnnkbiygL06H20GgofyowbbTSUoeet812GSxSmxwvcMNGPyTUMLvyD6OmPe2563teLcPUCFLQJhcQNvXDEux0Q26ZQM9ulXGbBA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=d+4IFBgd; arc=none smtp.client-ip=209.85.216.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="d+4IFBgd" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-2ff7cf599beso6282392a91.0 for ; Mon, 17 Mar 2025 21:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1742271291; x=1742876091; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=q/73Kpk2L7vMutO69KMLDlRxgU/lpzgb+NuxVOTOV6A=; b=d+4IFBgdlnRsARL/Mss+ihgrItD7PiQ02SUAMb3iCtSQNW0/qc88RfPiE286I2Hsz4 XCkEXvjIBxxVYgkJOCF6LOq57GirS0s8elP0xKW0+jbD1+AzXcFJAZwyyTuOusWCsnMV Nr55o/Zg8j0uutYLYa2MKm6LuilU9ExPkiQiFsuOWHzZkM7oTKvDc7MuQla/BLG57CMe gm8k1ov2bxiW+g02SPcv5+ElJsLIJ217Q5palzG4NJAGTMiD36RP72co5nEIBviG15Bi 7d82SwYiNj89XTbngmePZ3iyChiyiOFzpTTDxQTFhcZJNfrgj2R+QCyHBR5BX2qR8VQ6 Nc1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742271291; x=1742876091; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=q/73Kpk2L7vMutO69KMLDlRxgU/lpzgb+NuxVOTOV6A=; b=V3e+PmnGCzyWfA/v2ssttowkypkr4vOfwngl2EUK86cWs3ZLfh7RA1j2HJ2/V5pDl/ 1kE+2++SqRKsljDzQtETK19cGQOUxjVRFaeLa8HAGVsYC7Dm6whHTlhb0X4lCRoZnBPH 4sP1dNI8+I6V93gd6nZqaRxFYHHg44KjQDr5mhI0rOfCowVnppAI8C0dWjCdMhUMMXkk PCMr9a+rYmzEsMpqT8Y9/0SIFAUD33qRJUxMXq/+l+E19m5UCMFuH8YzzKkBHbEP28tw GccQ4KlSZR/slCDwML1vp0SO8qcr+TxRTexbFuhxOG/H0sD6tYltbPg+P3iSc6F2w8kR vqTQ== X-Forwarded-Encrypted: i=1; AJvYcCXM62WNBsyD0An8uRwk9YO9nLYqambrOVgEn5lPV7gT6DLbC2loGlRuv3n7nWoT77ODlM7fQyRqJETUx90=@vger.kernel.org X-Gm-Message-State: AOJu0YxSI6xMrkbJfnkR1trTSocmAeznzgXnFjoB0YXxBCd8VySmvBSw xCl6eMcAjppveudS7Vcx8wThM/EeRzw0Yjt5zAbUVrGmcsuY6CunlnEBWvP2xRqBIrqZnZka0CO eOwZ/ng== X-Google-Smtp-Source: AGHT+IFcAfBEQciZiHy7t7Sm89sYmqUs7Yj7t+9M+SoNXAE5qEt6Y0tXRSIqYugJh7uXMU3uF3V9yse6JCAi X-Received: from pfl8.prod.google.com ([2002:a05:6a00:708:b0:736:3cd5:ba3a]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:4325:b0:1ee:e96a:d9ed with SMTP id adf61e73a8af0-1fa43ace812mr2992442637.7.1742271290868; Mon, 17 Mar 2025 21:14:50 -0700 (PDT) Date: Mon, 17 Mar 2025 21:14:38 -0700 In-Reply-To: <20250318041442.321230-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250318041442.321230-1-irogers@google.com> X-Mailer: git-send-email 2.49.0.rc1.451.g8f38331e32-goog Message-ID: <20250318041442.321230-2-irogers@google.com> Subject: [PATCH v1 1/5] perf stat: Better hybrid support for the NMI watchdog warning From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , Howard Chu , Weilin Wang , Levi Yun , "Dr. David Alan Gilbert" , Andi Kleen , James Clark , Dominique Martinet , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Prior to this patch evlist__has_hybrid would return false if the processor wasn't hybrid or the evlist didn't contain any core events. If the only PMU used by events was cpu_core then it would true even though there are no cpu_atom events. For example: ``` $ perf stat --cputype=3Dcpu_core -e '{cycles,cycles,cycles,cycles,cycles,cy= cles,cycles,cycles,cycles}' true Performance counter stats for 'true': cpu_core/cycles/ = (0.00%) cpu_core/cycles/ = (0.00%) cpu_core/cycles/ = (0.00%) cpu_core/cycles/ = (0.00%) cpu_core/cycles/ = (0.00%) cpu_core/cycles/ = (0.00%) cpu_core/cycles/ = (0.00%) cpu_core/cycles/ = (0.00%) cpu_core/cycles/ = (0.00%) 0.001981900 seconds time elapsed 0.002311000 seconds user 0.000000000 seconds sys ``` This patch changes evlist__has_hybrid to return true only if the evlist contains events from >1 core PMU. This means the NMI watchdog warning is shown for the case above. Signed-off-by: Ian Rogers --- tools/perf/util/stat-display.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index e852ac0d9847..f311f1960e29 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -825,13 +825,25 @@ static bool is_mixed_hw_group(struct evsel *counter) static bool evlist__has_hybrid(struct evlist *evlist) { struct evsel *evsel; + struct perf_pmu *last_core_pmu =3D NULL; =20 if (perf_pmus__num_core_pmus() =3D=3D 1) return false; =20 evlist__for_each_entry(evlist, evsel) { - if (evsel->core.is_pmu_core) + if (evsel->core.is_pmu_core) { + struct perf_pmu *pmu =3D evsel__find_pmu(evsel); + + if (pmu =3D=3D last_core_pmu) + continue; + + if (last_core_pmu =3D=3D NULL) { + last_core_pmu =3D pmu; + continue; + } + /* A distinct core PMU. */ return true; + } } =20 return false; --=20 2.49.0.rc1.451.g8f38331e32-goog From nobody Wed Dec 17 12:06:29 2025 Received: from mail-oa1-f73.google.com (mail-oa1-f73.google.com [209.85.160.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADE271B414B for ; Tue, 18 Mar 2025 04:14:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742271295; cv=none; b=lcP0RNJof0il3BuBeQqMQWYof8wfN3qyAv5/BqA+o2vLwLOQR0Q/nRrCUZ1PCRgYVyT4Vfm+ucwSVldzkLZiC/8a+wVDoK+fNQeIC9JDaA0nCd1H/5Z8575ri0e54J1qVRexwtpLYcl0ZQU08K265Oz05helWGYcVvp+6q7ytBQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742271295; c=relaxed/simple; bh=1ifexhJwUBdmaJDGG25z0IZv2DVc0saV1QH/eEcKA84=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=aU4UPh89UE2NFEfvXMClEmiK+ii8Kh0KP8R4Kj2yq/lNz2uvKHhLvTN+I9gUrpgjAdtqeGMs86FFfu9DlbQAbRNLvNNBLj2uUWwuKMstAibM+zzITfDWu/ch+zayu/ofx52B0lmbtcaV7/TBaYxW9amAwbnq4zijhvb9tI3Dp2g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=4JR+e9V/; arc=none smtp.client-ip=209.85.160.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="4JR+e9V/" Received: by mail-oa1-f73.google.com with SMTP id 586e51a60fabf-2c2bd2872c4so1568284fac.3 for ; Mon, 17 Mar 2025 21:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1742271293; x=1742876093; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=uZBuQKhM+u9c6pepP6gqKhQVXCUikQqb1UN6fdxC8pQ=; b=4JR+e9V/qRzkfnJ4Y+QPNMkwOW1fYuFejr9KA6DQeZY4LCrMLKhOaq/V2LW6Op31CV B6im6/SaCdRdw311hbnkxYchEAXvR1a3QFkeVdJED4RspaMCAV4BCx2RY6sJdP86lI43 jrV5t4QXRHCd5UchmWBJDMRuvKKoowyLGCy2Q0uNw0y9vp6fhXgYIfHxzRr7PtJ/um3s Xkld9lsd0tuPUC2voV4Dg+L4b6k7B9qa7N6AX665vU1QCm6+3PGrpbNv7429Pm9KkZdJ Mf1S0oYZR2Z4RSbMOHj1/apaTKHz1XeiPLwjFU8VQiIZtcyyRjQjNj3JmU7EFUnsioH6 tHdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742271293; x=1742876093; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uZBuQKhM+u9c6pepP6gqKhQVXCUikQqb1UN6fdxC8pQ=; b=HmDgykNx0p5zTbMW9PsUYf1A13/FvMcKIYRO5xSK+X2S1TbUTn2MCdrVYoodsPoVPB Wu7ms4HZy4NBNrgzj0Ye2No0IH+TrWHEZYfg9sdV/G0ZYAAKfSP8kp1m+dbwI3iwSkfc GaVr6a+QOWGgu8WZBa3kW+PyUciER2T1ADVGcDQV6eXDjWgYQcqHSaqSyBle/ZUWAtSP Jl8Is9HxtmI/8ZAiZNk/kfzYqRP/jSWsAsHxjYg/maXOTkjXB9bAYTCSGAmkVN32gOgg vsG3BwVy1Wp+9nqzBYGnn9NGf6nLe2CT2UDma95Q9U6uvdj1i4Tmf8SP/tiUWOiYjITx n5nw== X-Forwarded-Encrypted: i=1; AJvYcCV6W7JJQz1tcLViVULHY7j2LnF/4vP8uoBTNwuAbYNBlAQpjPLAVtH47Dkwsy6PeTinqOun2mCaHxMeVOw=@vger.kernel.org X-Gm-Message-State: AOJu0YxTRBheZNp3zdhWh89N3aKFjTyiRk8vwsugC5hCXWy/T7Utzg6b YsZaseDghOZM/wQYEKXPHICKf7On5HUkkNbpUJc78a6k1ss5yx/wJTu78F7OgYFMAtw7gkwdmWj uxXePsw== X-Google-Smtp-Source: AGHT+IHGwEtX1e44VeoF08hASz/dr/doRnth0R2Nh6U3dXLSsvJEuOjhpPAqND3KAFY16udrSphrHf+yI2dL X-Received: from oabsf10.prod.google.com ([2002:a05:6871:230a:b0:2bc:6ad3:5671]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6870:468d:b0:29e:80d8:31a9 with SMTP id 586e51a60fabf-2c719f157d9mr1055815fac.2.1742271292698; Mon, 17 Mar 2025 21:14:52 -0700 (PDT) Date: Mon, 17 Mar 2025 21:14:39 -0700 In-Reply-To: <20250318041442.321230-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250318041442.321230-1-irogers@google.com> X-Mailer: git-send-email 2.49.0.rc1.451.g8f38331e32-goog Message-ID: <20250318041442.321230-3-irogers@google.com> Subject: [PATCH v1 2/5] perf stat: Remove print_mixed_hw_group_error From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , Howard Chu , Weilin Wang , Levi Yun , "Dr. David Alan Gilbert" , Andi Kleen , James Clark , Dominique Martinet , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" print_mixed_hw_group_error will print a warning when a group of events uses different PMUs. This isn't possible to happen as parse_events__sort_events_and_fix_groups will break groups when this happens, adding the warning at the start of perf of: WARNING: events were regrouped to match PMUs As the previous mixed group warning can never happen, remove the associated code. Signed-off-by: Ian Rogers --- tools/perf/util/stat-display.c | 31 ------------------------------- tools/perf/util/stat.h | 1 - 2 files changed, 32 deletions(-) diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index f311f1960e29..1751a450f449 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -798,30 +798,6 @@ static void abs_printout(struct perf_stat_config *conf= ig, print_cgroup(config, os, evsel->cgrp); } =20 -static bool is_mixed_hw_group(struct evsel *counter) -{ - struct evlist *evlist =3D counter->evlist; - u32 pmu_type =3D counter->core.attr.type; - struct evsel *pos; - - if (counter->core.nr_members < 2) - return false; - - evlist__for_each_entry(evlist, pos) { - /* software events can be part of any hardware group */ - if (pos->core.attr.type =3D=3D PERF_TYPE_SOFTWARE) - continue; - if (pmu_type =3D=3D PERF_TYPE_SOFTWARE) { - pmu_type =3D pos->core.attr.type; - continue; - } - if (pmu_type !=3D pos->core.attr.type) - return true; - } - - return false; -} - static bool evlist__has_hybrid(struct evlist *evlist) { struct evsel *evsel; @@ -886,8 +862,6 @@ static void printout(struct perf_stat_config *config, s= truct outstate *os, if (counter->supported) { if (!evlist__has_hybrid(counter->evlist)) { config->print_free_counters_hint =3D 1; - if (is_mixed_hw_group(counter)) - config->print_mixed_hw_group_error =3D 1; } } } @@ -1587,11 +1561,6 @@ static void print_footer(struct perf_stat_config *co= nfig) " echo 0 > /proc/sys/kernel/nmi_watchdog\n" " perf stat ...\n" " echo 1 > /proc/sys/kernel/nmi_watchdog\n"); - - if (config->print_mixed_hw_group_error) - fprintf(output, - "The events in group usually have to be from " - "the same PMU. Try reorganizing the group.\n"); } =20 static void print_percore(struct perf_stat_config *config, diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h index 2fda9acd7374..1bcd7634bf47 100644 --- a/tools/perf/util/stat.h +++ b/tools/perf/util/stat.h @@ -100,7 +100,6 @@ struct perf_stat_config { int times; int run_count; int print_free_counters_hint; - int print_mixed_hw_group_error; const char *csv_sep; struct stats *walltime_nsecs_stats; struct rusage ru_data; --=20 2.49.0.rc1.451.g8f38331e32-goog From nobody Wed Dec 17 12:06:29 2025 Received: from mail-ot1-f74.google.com (mail-ot1-f74.google.com [209.85.210.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 674261C3BFC for ; Tue, 18 Mar 2025 04:14:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742271297; cv=none; b=thC9ujnu7LfzEUNm+c1x+6YdrI7Y4pb0xMKJa+XJhiHyqu+oYK4RrLtFRsOSTUtNMyLL7853YhI+910QJS88sOOj1qPnrt/BlQ1ggcy1bHEhos65e2PncWNfZmfLWCAeXMHVDTIoYWEdLcCaZ5IRMKTym5Vds2GzASJVRgXhYsw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742271297; c=relaxed/simple; bh=nHqyEJ4/Frkdc7A1GAcvK78BriUbPBng6xe97aPEwzw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=FAClm3EthHT9OfWmsR9ujQFIa/4NVSGsDW3oaAnTMDUBpux6kXEfpvp4nPqFoduaxCi3qZS9sIpV3lrZ7wxNK7Dc1/7dLTy4+vtMH4FeDk9S4h3YV0ftS8uDirJfhR6RcA8OJ1bzNH/Qzw9z5KTWygulfdKxONA66mk4qGuy8OA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=3/gIR3O9; arc=none smtp.client-ip=209.85.210.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="3/gIR3O9" Received: by mail-ot1-f74.google.com with SMTP id 46e09a7af769-72b7c00f3c6so1061943a34.0 for ; Mon, 17 Mar 2025 21:14:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1742271294; x=1742876094; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=aCcMnU2SSC+0PDpp+5Nsu8Z6wRNoNoKoEAEvbkUeMQ8=; b=3/gIR3O9t1KeDuCWgZuOcF9e1h/G64BroUP/Jp9Vp9j3rKh9Ryp2VjwNSRlBvLoCq1 ZgrXq5k5nuPHlBg1zU/N1P2rw9MvXP/Paehnss8UYpo0/c5YU7qWMPJ8fIWmibk/orj5 ZkoJBMbcEoOA+hfSDS62kIUFnPMbKPzEkF4XszZsa2zkhopRSKNTYcX95V8qeEiXmCkB gaFIj3hpdQSDqcEg/g/eHVjwR95B5q3gBmkG5eSj9oDnErWFAronJ1HE89+6ohwMtqFk W2MVTlxu15Y9AG1KJjktG1ci4XL0Q42mozoEG2/OWnVd8motjHyOl0n9BR3+iAWdYbju ZJ8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742271294; x=1742876094; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aCcMnU2SSC+0PDpp+5Nsu8Z6wRNoNoKoEAEvbkUeMQ8=; b=M/WNHG0HW62cjOvQSSnYnwpxUTwtMKRrsnsMpO6UquOOMKIO7Gw2KyTZrEpsb3H2Pd 9D+7+Hmycw3rjSyqegxA1Nz1ssYDhBa9FiVutwo9ea3+hNMLgmNuod9ked/a2UnKhqUk Xkcw37Q5Pc5yjkOvvSMGU+L5Xo6mR0DB8A+wWeymZ6ZCUCeQKAKGiZ0fhEOFrIO5Jj75 DJ0aUNB1jRQoI6ilAdXrtbGFJiCpfgquqqukL2gM3Qhuvdr8eiZF3lfu4wwBVrOfgVbn 9EU9S39JlVw3NhG+pdjHwjszhMmUneneOe6evJT4iQngpE4UBuA17y1I/cQ040+RI4uc NBRg== X-Forwarded-Encrypted: i=1; AJvYcCWL0H7+URgROGzhttat3WVLDfDFH9COBEq2WGMOeLWSjROId5X9dgxs7ss6xUlOtAn/2ivf9nBN4RPi5TM=@vger.kernel.org X-Gm-Message-State: AOJu0YwIg5uTYeMdTkiX5RzEqCiiWkg/IEzEMUyPnZ0WcoMeKUrwaNNZ lhFnHdqA1dyXRt8372cZ0Enna/aIyu0pZ7Jo2suhi6AwzZxkZX2XJ/f5m1KeiOCpp90mVk6wqif a8S6AZw== X-Google-Smtp-Source: AGHT+IFr8MNVN+8peZtfP0hpzvVNp7OmNgDD1BofaL+Cr8mSNZvBSEabZbssxCe08EmPkK0Yd91sAqD0cAEa X-Received: from oabwh38.prod.google.com ([2002:a05:6871:a6a6:b0:29e:6524:e13e]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6830:25c4:b0:72a:449e:2b69 with SMTP id 46e09a7af769-72bbc543b53mr8336303a34.28.1742271294520; Mon, 17 Mar 2025 21:14:54 -0700 (PDT) Date: Mon, 17 Mar 2025 21:14:40 -0700 In-Reply-To: <20250318041442.321230-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250318041442.321230-1-irogers@google.com> X-Mailer: git-send-email 2.49.0.rc1.451.g8f38331e32-goog Message-ID: <20250318041442.321230-4-irogers@google.com> Subject: [PATCH v1 3/5] perf evlist: Refactor evlist__scnprintf_evsels From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , Howard Chu , Weilin Wang , Levi Yun , "Dr. David Alan Gilbert" , Andi Kleen , James Clark , Dominique Martinet , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Switch output to using a strbuf so the storage can be resized. Rename as scnprintf is no longer used. Signed-off-by: Ian Rogers --- tools/perf/builtin-record.c | 9 ++++++--- tools/perf/util/evlist.c | 19 +++++++++---------- tools/perf/util/evlist.h | 3 ++- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index ba20bf7c011d..cea5959adadc 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -51,6 +51,7 @@ #include "util/clockid.h" #include "util/off_cpu.h" #include "util/bpf-filter.h" +#include "util/strbuf.h" #include "asm/bug.h" #include "perf.h" #include "cputopo.h" @@ -2784,13 +2785,15 @@ static int __cmd_record(struct record *rec, int arg= c, const char **argv) record__auxtrace_snapshot_exit(rec); =20 if (forks && workload_exec_errno) { - char msg[STRERR_BUFSIZE], strevsels[2048]; + char msg[STRERR_BUFSIZE]; const char *emsg =3D str_error_r(workload_exec_errno, msg, sizeof(msg)); + struct strbuf sb =3D STRBUF_INIT; =20 - evlist__scnprintf_evsels(rec->evlist, sizeof(strevsels), strevsels); + evlist__format_evsels(rec->evlist, &sb); =20 pr_err("Failed to collect '%s' for the '%s' workload: %s\n", - strevsels, argv[0], emsg); + sb.buf, argv[0], emsg); + strbuf_release(&sb); err =3D -1; goto out_child; } diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 49e10d6981ad..96cfc7ed1512 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -35,6 +35,7 @@ #include "util/util.h" #include "util/env.h" #include "util/intel-tpebs.h" +#include "util/strbuf.h" #include #include #include @@ -2468,23 +2469,21 @@ struct evsel *evlist__find_evsel(struct evlist *evl= ist, int idx) return NULL; } =20 -int evlist__scnprintf_evsels(struct evlist *evlist, size_t size, char *bf) +void evlist__format_evsels(struct evlist *evlist, struct strbuf *sb) { struct evsel *evsel; - int printed =3D 0; + bool first =3D true; =20 evlist__for_each_entry(evlist, evsel) { if (evsel__is_dummy_event(evsel)) continue; - if (size > (strlen(evsel__name(evsel)) + (printed ? 2 : 1))) { - printed +=3D scnprintf(bf + printed, size - printed, "%s%s", printed ? = "," : "", evsel__name(evsel)); - } else { - printed +=3D scnprintf(bf + printed, size - printed, "%s...", printed ?= "," : ""); - break; - } - } =20 - return printed; + if (!first) + strbuf_addch(sb, ','); + + strbuf_addstr(sb, evsel__name(evsel)); + first =3D false; + } } =20 void evlist__check_mem_load_aux(struct evlist *evlist) diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index edcbf1c10e92..5fe5cfbbebb1 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h @@ -20,6 +20,7 @@ struct pollfd; struct thread_map; struct perf_cpu_map; struct record_opts; +struct strbuf; struct target; =20 /* @@ -430,7 +431,7 @@ int event_enable_timer__process(struct event_enable_tim= er *eet); =20 struct evsel *evlist__find_evsel(struct evlist *evlist, int idx); =20 -int evlist__scnprintf_evsels(struct evlist *evlist, size_t size, char *bf); +void evlist__format_evsels(struct evlist *evlist, struct strbuf *sb); void evlist__check_mem_load_aux(struct evlist *evlist); void evlist__warn_user_requested_cpus(struct evlist *evlist, const char *c= pu_list); void evlist__uniquify_name(struct evlist *evlist); --=20 2.49.0.rc1.451.g8f38331e32-goog From nobody Wed Dec 17 12:06:29 2025 Received: from mail-oa1-f74.google.com (mail-oa1-f74.google.com [209.85.160.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 557271C6FFA for ; Tue, 18 Mar 2025 04:14:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742271298; cv=none; b=Fwx4KMYc1b0byy83xiNpEhTlYTkHUUxXae7buiaNcCmO9c8iNpOM2YpH68Kc0hmUTiMyTjZn/aBEUiVN9EEE+zaLKyKtrlIzFTI2/TrlGw1MvwsaeBTWYOdDuFAqv9d8N+4bv5zGcyFPVi2gzgR5BrRfIvrHoRkvf7SSSCQqcmw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742271298; c=relaxed/simple; bh=wkcLWmBn5YfSkrqCgjPW+KecUlbd3s8XqELqjHa497Q=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=nGA+itvBvxYTnn6FIAb1Kn4E+JfyOsV0vWFWsfRZdGAhim+QChkD89kWA8OEBviGKkFMQYt8GYIusavotUTCJNKIfbpbgSV3qdL8759WmwW7Iee22AqtGWZk3jBm/oyTt+gFKEScaG63g5RlKYFPTRUR+Q3Sri/ORJb5zUvX5PI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=mksoWD+7; arc=none smtp.client-ip=209.85.160.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="mksoWD+7" Received: by mail-oa1-f74.google.com with SMTP id 586e51a60fabf-2c2451f5cc8so4000179fac.1 for ; Mon, 17 Mar 2025 21:14:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1742271296; x=1742876096; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=w5tqXzSB63leZ7R3ZWij8NvB4IshQW3WEuW90/a1hhI=; b=mksoWD+7pjMmmFzibDQohS8FQK9ZCv01UyDUJq4KZUfi+DZVNSn6hhoYOg7+EKwvOr cdh0/bKyqQz4wkkxkFVsHwcw12beoCU1ZhoWcvzW0s1h60G8vx+VYF4uy3N6R1ke+Q6u hHulVuy7MA+fPy9at9fv3/wYiDwkSLDcGWCnLFwjzyW1avkPIC5k+MnmzP48v5fLwkFN n6UvvM4YcVB1TBs9RQztFv2eRCJVrRdEO0Y3JvW0BT+BYEfJroMavMqPflyet03GnMUB qRqgG9IssMz9fBhBSAlrAz7+4t2nJJSxF+x1pBlqHw1UHiFsC2TaLmEAk+GjkbsjkLsT Eppw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742271296; x=1742876096; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w5tqXzSB63leZ7R3ZWij8NvB4IshQW3WEuW90/a1hhI=; b=jVFZY9ubEaFFnikY5lijT5xPk0OWQgARUippKNUJDgaZE+zQ2uqrY9EbkHYGL0E8Sp /hlfbvxzm/VJGBrXUqELgbrDafKMeKYErl1A3D4zdzgusB3+KEacy1ETcGdY3BHkvzNw C8A5yY5NoM+fZDPMO47MV34kgu2kd+YSEuHlO3nGLROUJe1iLi5pR3jlnMwR2Os5V0so wmSzpLqTTwL/t93zrBxe6yyPPXS2dhdsrM9r9bk/GqS6c2rqFiwCphsDdIeejYsz0azc 7P5kqYJxbP4qrK3wdQgXBG+57AWu+1FQB2NhW435jVZnhUOlzVmKi3ZuMN0/nHz3VLDe VjMQ== X-Forwarded-Encrypted: i=1; AJvYcCXxgh/nfYt5fk7FavyHxuIbdXdZ39RNxKBYZuI0atltfZbRPc/0sDiUjjRJY36OZH2gHfiUWEZN4FnOIRc=@vger.kernel.org X-Gm-Message-State: AOJu0YxGZaW0MrmRN1NeTdaMfxih2hnxo+kD5IY6qFFW2o4xvU7sAURj BRsbtp1MknHttF2AvSUhbz7one8jSvooUCJ/z/GyJB605Fqz4QDLi38/m0XJl38lt5kaIV+d/0q VvCgARw== X-Google-Smtp-Source: AGHT+IEkyqrCGwo/Q7at+ImZvcMpDLZizAESd0WtnXKupQeighIKPBCF5RT7wqXmUuEle6WQZ28QjSW2Y1se X-Received: from oablv6.prod.google.com ([2002:a05:6871:4386:b0:2c1:64e4:adb9]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6870:e40f:b0:296:a67c:d239 with SMTP id 586e51a60fabf-2c690f3b3f0mr7815648fac.12.1742271296325; Mon, 17 Mar 2025 21:14:56 -0700 (PDT) Date: Mon, 17 Mar 2025 21:14:41 -0700 In-Reply-To: <20250318041442.321230-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250318041442.321230-1-irogers@google.com> X-Mailer: git-send-email 2.49.0.rc1.451.g8f38331e32-goog Message-ID: <20250318041442.321230-5-irogers@google.com> Subject: [PATCH v1 4/5] perf evlist: Add groups to evlist__format_evsels From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , Howard Chu , Weilin Wang , Levi Yun , "Dr. David Alan Gilbert" , Andi Kleen , James Clark , Dominique Martinet , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Make groups visible in output: Before: {cycles,instructions} -> cpu_atom/cycles/,cpu_atom/instructions/,cpu_core/cycles/,cpu_core/instructi= ons/ After: {cycles,instructions} -> {cpu_atom/cycles/,cpu_atom/instructions/},{cpu_core/cycles/,cpu_core/instru= ctions/} Signed-off-by: Ian Rogers --- tools/perf/util/evlist.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 96cfc7ed1512..b59fa407be44 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -2471,19 +2471,30 @@ struct evsel *evlist__find_evsel(struct evlist *evl= ist, int idx) =20 void evlist__format_evsels(struct evlist *evlist, struct strbuf *sb) { - struct evsel *evsel; + struct evsel *evsel, *leader =3D NULL; bool first =3D true; =20 evlist__for_each_entry(evlist, evsel) { + struct evsel *new_leader =3D evsel__leader(evsel); + if (evsel__is_dummy_event(evsel)) continue; =20 + if (leader !=3D new_leader && leader && leader->core.nr_members > 1) + strbuf_addch(sb, '}'); + if (!first) strbuf_addch(sb, ','); =20 + if (leader !=3D new_leader && new_leader->core.nr_members > 1) + strbuf_addch(sb, '{'); + strbuf_addstr(sb, evsel__name(evsel)); first =3D false; + leader =3D new_leader; } + if (leader && leader->core.nr_members > 1) + strbuf_addch(sb, '}'); } =20 void evlist__check_mem_load_aux(struct evlist *evlist) --=20 2.49.0.rc1.451.g8f38331e32-goog From nobody Wed Dec 17 12:06:29 2025 Received: from mail-oo1-f73.google.com (mail-oo1-f73.google.com [209.85.161.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E9461C8615 for ; Tue, 18 Mar 2025 04:14:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742271300; cv=none; b=T2Y74d8XrXI9WlbAeGeX20RflNhrLmZRaQFuIpVApAqqduKB12weLw2otY9E64nHu1iNyhf0I1/ReW+LLY67Il6iZtrL0/qSi2nANpPoQ63qU/rg9NLgOiJZyepOHPPkIlXOU24tJFGcLyFzVBpyWyNu1QE8XsSOtuzFeq0uVF8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742271300; c=relaxed/simple; bh=nM7VLv/vcPJb8IP1hkBb7xTP6rJT9gjNNb4KuBio9Y4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=C7Z1aSO2D2zN5cSBsu+i7Ynxt1KjMyfedDgDoONw9rxR/jhg84KXp6bARzzXifsw5ikHIRYALWV0SQw1wpYl7mDDIs5fGuuGkbBlkrrVvBb1fknBq/UcUWB1+MnKlqzPV1iDtwKCLOBmumQcJlZbtzwV+kU6o/Jz+sidWA9MZSA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=eV5dO8Sv; arc=none smtp.client-ip=209.85.161.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="eV5dO8Sv" Received: by mail-oo1-f73.google.com with SMTP id 006d021491bc7-601e0f09262so1032792eaf.2 for ; Mon, 17 Mar 2025 21:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1742271298; x=1742876098; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=IcTDVc7sWc+BX5SOaqTWz06HZw+0rggI949f/hqkkSw=; b=eV5dO8Svo2y5cx6scAbegntfkkIeovgL7zY+a8uboV0Ftt5ma7eC0YFUS8R/6EsS9N LdTj8VRvqIkz0VLFNwe4F8+7eCFeovD3enCkGwLkYHT4ZI6q4gDxcZmJY/Otz+91WqMh O/wtBSoXAhqFbnhCEathU/RfRNk6OWFIBIYMAZ9rSnVC0DGX8XPndu/oCZdSYWfbRdmf DoO442o5m0IaL0I81MM+QbqV3m25HBrXq4o3+JD+57ZMQyddj3h3OoeGuoV8GBYAOPEO hjJ7q0DxobxGPWSgU4kIwYwQzUFR2ZyhtOnMMTkaBnoxTyt4/ZC8B7/asIQNH2gS1Xuu Vqkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742271298; x=1742876098; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IcTDVc7sWc+BX5SOaqTWz06HZw+0rggI949f/hqkkSw=; b=qnsvIsZVjcAV5Do+N9OWOVh4NvjXvGP3llVhMmgBgBvKzpWMDYkPk434NWLGL8UYA7 ildCKGbqo6QMeEHjhYgB3lm8nor6sRGJ1IxIm6lj8iUyoBN4uiPZje9WzJTm2usN4YIH 7Ek0JLgG1i7QIdT81Woe3OHDIVRHsLF7xB2NV22KlIVzTwmYt4y1jOHPNwFl0vsWrDJI moeEdEH3Pq1eEfzdHh49hn8vd+kTeLnDIqvdei/+GYlwdO5/aG7Ym67nzKh0f1nEWN1z dqpgucZIrGLSD96ZCX42IO8j1cqhfI8o121OZ3iXxsNUunJ+8lnbs/2uTYZNB7zU7Tlu 4hlg== X-Forwarded-Encrypted: i=1; AJvYcCUH5UQlpUJL8tA+ajKRldifpbNgo3kP2Pi2alXNa3ULSoo2qcO25hc79LDOkVQKKQubayGrFJVLuDISSIg=@vger.kernel.org X-Gm-Message-State: AOJu0YwA+eHTWzhlVTtv7vNcCMjNCVBKJfSF2no6GodovfWy+DwaM+a6 bwCVOa9dcIlvtp4jzlgETdRyll6BjXp1x52c3Z4fqsUEI0fy7nPNf6KYaKYbbjfSzVE6aXZsqaF fz4+xgw== X-Google-Smtp-Source: AGHT+IHbiPc7HGDa8UDDNXiyyyNYm3dPD9ip4rcffjkWbCIt+vvE/ogOPNPgJ48eQYU33l1n9NXH5ew2ke34 X-Received: from oabhq15.prod.google.com ([2002:a05:6870:9b0f:b0:2c2:67a4:62b1]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6870:d614:b0:2c2:d2b8:e1ab with SMTP id 586e51a60fabf-2c690feb31dmr7568764fac.18.1742271298202; Mon, 17 Mar 2025 21:14:58 -0700 (PDT) Date: Mon, 17 Mar 2025 21:14:42 -0700 In-Reply-To: <20250318041442.321230-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250318041442.321230-1-irogers@google.com> X-Mailer: git-send-email 2.49.0.rc1.451.g8f38331e32-goog Message-ID: <20250318041442.321230-6-irogers@google.com> Subject: [PATCH v1 5/5] perf parse-events: Add debug dump of evlist if reordered From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , Howard Chu , Weilin Wang , Levi Yun , "Dr. David Alan Gilbert" , Andi Kleen , James Clark , Dominique Martinet , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add debug verbose output to show how evsels were reordered by parse_events__sort_events_and_fix_groups. For example: ``` $ perf record -v -e '{instructions,cycles}' true Using CPUID GenuineIntel-6-B7-1 WARNING: events were regrouped to match PMUs evlist after sorting/fixing: '{cpu_atom/instructions/,cpu_atom/cycles/},{cp= u_core/instructions/,cpu_core/cycles/}' ``` Signed-off-by: Ian Rogers --- tools/perf/util/parse-events.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 5152fd5a6ead..cb76796bc5c7 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -28,6 +28,7 @@ #include "util/evsel_config.h" #include "util/event.h" #include "util/bpf-filter.h" +#include "util/stat.h" #include "util/util.h" #include "tracepoint.h" =20 @@ -2196,14 +2197,23 @@ int __parse_events(struct evlist *evlist, const cha= r *str, const char *pmu_filte if (ret2 < 0) return ret; =20 - if (ret2 && warn_if_reordered && !parse_state.wild_card_pmus) - pr_warning("WARNING: events were regrouped to match PMUs\n"); - /* * Add list to the evlist even with errors to allow callers to clean up. */ evlist__splice_list_tail(evlist, &parse_state.list); =20 + if (ret2 && warn_if_reordered && !parse_state.wild_card_pmus) { + pr_warning("WARNING: events were regrouped to match PMUs\n"); + + if (verbose > 0) { + struct strbuf sb =3D STRBUF_INIT; + + evlist__uniquify_name(evlist); + evlist__format_evsels(evlist, &sb); + pr_debug("evlist after sorting/fixing: '%s'\n", sb.buf); + strbuf_release(&sb); + } + } if (!ret) { struct evsel *last; =20 --=20 2.49.0.rc1.451.g8f38331e32-goog