From nobody Mon Apr 6 09:11:38 2026 Received: from mail-dy1-f201.google.com (mail-dy1-f201.google.com [74.125.82.201]) (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 06EF63368BB for ; Sat, 4 Apr 2026 03:44:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775274246; cv=none; b=jqN1m60LkR6Xi1NUj4GirHJ78z2XpJ+ghTcTwICJPGnZMSc55EFSplVpUyGRP436ShNrt/XfsgAD2yvWsRs4EQP1SylJ4NtF2Y32W3DSIJNf/wN6OpYl0Di7UnGbsjoMHc6xZTWPElB81TVpfWtsR7Pivy1RArLjwX4sw+k2CbU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775274246; c=relaxed/simple; bh=woVK730/m2g6PPS9x8P/giHxXs9+wVRn/ViMS/wmhlY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=q34dBG0R8hKmp+U9sZnuONfDg0KqT5IulgEinW7EbseMjMhbl34zouF+Gmf3WKsoXP9ITDMIA/a1sSfThBnuAEZxjtKZrIsDXFerqqgpwQrsR3eAT26o8Zj+81anyt19cWLPIlPhPzq3jnpKaTlN/1Nu2Dv73v7n6EkbXt+C9vQ= 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=AWhQsK/m; arc=none smtp.client-ip=74.125.82.201 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="AWhQsK/m" Received: by mail-dy1-f201.google.com with SMTP id 5a478bee46e88-2bdc1b30ac8so15731923eec.1 for ; Fri, 03 Apr 2026 20:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1775274244; x=1775879044; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=rGBBXdpiWePuw/59wMcLGdfD0cYwMcREBloyciHzDuw=; b=AWhQsK/mRHqCyI8X2RwYETW1+HX49aHF/U6JrY22WlJJtoFtACxBcWGVdtbcPSMwko mF3Ix2t6I2xgDpeKtlkN3nEfLIXr1LJEkwSLyChUGvz9A9x5gOda/qxxuG90auGl9o5k EBuSWplk/vJn5GnhBWJdBRGclEstiVowR/a60B0u/N5YMs+lDcoXTSk1OPwp2v+e04bE kt9up9fKYodS6hBLyn+TVVXJNISokBdy0YiCb15lDz+s11XD6pBpIxGv6IIJWcYHsEmX fCv+Ttf5YpnSGOjvdQV8pTvFjJrwMMG5z/y6JrlUbI0IEsETFYty9u2HjtujOSo5U9Ip /8UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775274244; x=1775879044; h=cc: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=rGBBXdpiWePuw/59wMcLGdfD0cYwMcREBloyciHzDuw=; b=UZygdHAglW9uUuiYBUufJGA+yJGSLZm8rwrVkaiC308od5smwf7xO2oft7B8Cq+NtI sX45VunoBLQ0ToI30iG5DRcNN4lGiaV6ODuJsd82nNREgbsK5/ksJQygQEjjklXKzfK3 bUVBj97CfPtmdVqrXY5946HAtr1Jd2F3TMhTZ/p8Cd4xyAbUS388qkA+r+iDRE9+DgKY ypY42MCJlV0DBF5xiDj4OVlWoFPaNMG1wDNaqm9hRFiwTPNjuhDPYPOFVJHDC2YA6j55 0AHS2805jqhUZRA4RMYZzles0T93jSXjUupDeeqzisDjxttszwAviAxGaix+LdXOrehR /Jyg== X-Forwarded-Encrypted: i=1; AJvYcCW4SIJnzgJBtAHqAaH7+2lhJBZ2cyXkmZDJk3TlprhM66hTOdzROT610PZkYkCQxoF4Eq0TQ3z0CeskXPc=@vger.kernel.org X-Gm-Message-State: AOJu0YwAG6jJZsyEdc0FLCXwhbxDYNhRJ8msW3BpxNYGndsm6LGgv4yo YSwSZsTXDYyJ9oJhrGgLsFSd/3N6VczyqTxkcpX4b1RpU2rB0WLAA3+n+Ix23ShE00IdQxAaUc+ FZ6ix4b20Ig== X-Received: from dyckg5.prod.google.com ([2002:a05:7301:d185:b0:2c1:264d:62f]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7301:5793:b0:2b0:571a:28a5 with SMTP id 5a478bee46e88-2cbfba8dc09mr2640946eec.18.1775274244057; Fri, 03 Apr 2026 20:44:04 -0700 (PDT) Date: Fri, 3 Apr 2026 20:43:12 -0700 In-Reply-To: <20260404034325.3172592-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: <20260403204017.2919994-1-irogers@google.com> <20260404034325.3172592-1-irogers@google.com> X-Mailer: git-send-email 2.53.0.1213.gd9a14994de-goog Message-ID: <20260404034325.3172592-13-irogers@google.com> Subject: [PATCH v6 12/25] perf db-export: Remove evsel from struct export_sample From: Ian Rogers To: acme@kernel.org, namhyung@kernel.org Cc: irogers@google.com, adrian.hunter@intel.com, ajones@ventanamicro.com, ak@linux.intel.com, alex@ghiti.fr, alexander.shishkin@linux.intel.com, anup@brainfault.org, aou@eecs.berkeley.edu, atrajeev@linux.ibm.com, blakejones@google.com, ctshao@google.com, dapeng1.mi@linux.intel.com, derek.foreman@collabora.com, dvyukov@google.com, howardchu95@gmail.com, hrishikesh123s@gmail.com, james.clark@linaro.org, jolsa@kernel.org, krzysztof.m.lopatowski@gmail.com, leo.yan@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux@treblig.org, mingo@redhat.com, nichen@iscas.ac.cn, palmer@dabbelt.com, peterz@infradead.org, pjw@kernel.org, ravi.bangoria@amd.com, swapnil.sapkal@amd.com, tanze@kylinos.cn, thomas.falcon@intel.com, tianyou.li@intel.com, yujie.liu@intel.com, zhouquan@iscas.ac.cn Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" As the sample contains the evsel avoid the duplication. Remove the evsel from db_export__sample as it can also read from the sample. Signed-off-by: Ian Rogers --- tools/perf/util/db-export.c | 5 ++--- tools/perf/util/db-export.h | 3 +-- tools/perf/util/scripting-engines/trace-event-python.c | 8 ++++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/perf/util/db-export.c b/tools/perf/util/db-export.c index a1f578c3a8d5..fdfd825c7ef4 100644 --- a/tools/perf/util/db-export.c +++ b/tools/perf/util/db-export.c @@ -345,14 +345,13 @@ static int db_export__threads(struct db_export *dbe, = struct thread *thread, } =20 int db_export__sample(struct db_export *dbe, union perf_event *event, - struct perf_sample *sample, struct evsel *evsel, + struct perf_sample *sample, struct addr_location *al, struct addr_location *addr_al) { struct thread *thread =3D al->thread; struct export_sample es =3D { .event =3D event, .sample =3D sample, - .evsel =3D evsel, .al =3D al, }; struct thread *main_thread; @@ -365,7 +364,7 @@ int db_export__sample(struct db_export *dbe, union perf= _event *event, if (!machine) return -1; =20 - err =3D db_export__evsel(dbe, evsel); + err =3D db_export__evsel(dbe, sample->evsel); if (err) return err; =20 diff --git a/tools/perf/util/db-export.h b/tools/perf/util/db-export.h index 23983cb35706..1abbfd398e3a 100644 --- a/tools/perf/util/db-export.h +++ b/tools/perf/util/db-export.h @@ -25,7 +25,6 @@ struct call_return; struct export_sample { union perf_event *event; struct perf_sample *sample; - struct evsel *evsel; struct addr_location *al; u64 db_id; u64 comm_db_id; @@ -96,7 +95,7 @@ int db_export__symbol(struct db_export *dbe, struct symbo= l *sym, int db_export__branch_type(struct db_export *dbe, u32 branch_type, const char *name); int db_export__sample(struct db_export *dbe, union perf_event *event, - struct perf_sample *sample, struct evsel *evsel, + struct perf_sample *sample, struct addr_location *al, struct addr_location *addr_al); =20 int db_export__branch_types(struct db_export *dbe); diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools= /perf/util/scripting-engines/trace-event-python.c index 1537122167d5..9e1069ec0578 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -1312,7 +1312,7 @@ static void python_export_sample_table(struct db_expo= rt *dbe, t =3D tuple_new(28); =20 tuple_set_d64(t, 0, es->db_id); - tuple_set_d64(t, 1, es->evsel->db_id); + tuple_set_d64(t, 1, es->sample->evsel->db_id); tuple_set_d64(t, 2, maps__machine(thread__maps(es->al->thread))->db_id); tuple_set_d64(t, 3, thread__db_id(es->al->thread)); tuple_set_d64(t, 4, es->comm_db_id); @@ -1353,7 +1353,7 @@ static void python_export_synth(struct db_export *dbe= , struct export_sample *es) t =3D tuple_new(3); =20 tuple_set_d64(t, 0, es->db_id); - tuple_set_d64(t, 1, es->evsel->core.attr.config); + tuple_set_d64(t, 1, es->sample->evsel->core.attr.config); tuple_set_bytes(t, 2, es->sample->raw_data, es->sample->raw_size); =20 call_object(tables->synth_handler, t, "synth_data"); @@ -1368,7 +1368,7 @@ static int python_export_sample(struct db_export *dbe, =20 python_export_sample_table(dbe, es); =20 - if (es->evsel->core.attr.type =3D=3D PERF_TYPE_SYNTH && tables->synth_han= dler) + if (es->sample->evsel->core.attr.type =3D=3D PERF_TYPE_SYNTH && tables->s= ynth_handler) python_export_synth(dbe, es); =20 return 0; @@ -1517,7 +1517,7 @@ static void python_process_event(union perf_event *ev= ent, /* Reserve for future process_hw/sw/raw APIs */ default: if (tables->db_export_mode) - db_export__sample(&tables->dbe, event, sample, evsel, al, addr_al); + db_export__sample(&tables->dbe, event, sample, al, addr_al); else python_process_general_event(sample, evsel, al, addr_al); } --=20 2.53.0.1213.gd9a14994de-goog