From nobody Tue Dec 16 22:12:57 2025 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) (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 8767C2571C6 for ; Thu, 29 May 2025 04:40:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748493625; cv=none; b=ZoYZkLn/SYdZoiNb1TlOkb9iXexZF7X+AAyJEPsIaD3AYJchwDC9JmxW8AeTmvuywb8SNjV/cQrPkR1Pi85pakZrH4fJ35TnvWNf058+JvrwJJGsTpWltW+5DhOHl+9oHbx2yOH5EGpx97bXZpdgnVXHF44XyFYRpu47PSb47R0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748493625; c=relaxed/simple; bh=jsmqbC1vJZbprPguR7zwDCDHxB4zTIIrDoxTqEFx1LE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=C560GgjamqMMXbkdLAi1AMjbsZ7aSOBWP83JaPhbcDceZVuOuj6aItIQ1mLSNPVj94dH7rgBD6AAuW+S4rQPdLSItybie527gze/C+u5aeg4bw4YHqEa1/P0+dbhEKhzDJZL1R6poRbLXWFcjyE4/c8r01C77NNuxAw5VTVAfE8= 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=IKZ74dQb; arc=none smtp.client-ip=209.85.210.202 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="IKZ74dQb" Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-747a9ef52a4so605339b3a.2 for ; Wed, 28 May 2025 21:40:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1748493623; x=1749098423; 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=5JPEQx1UgA1kK0W1Kyi7k61uvOJ0V0RbXR9RGxgMDm8=; b=IKZ74dQbqtQhtAx25lDdHPwJTlggU2wkcLgJclnBJQ0EA3Qa2+RcHIN4Qj3Jf+AzSg 0y0GX14mzJL8qzW8tko9HSCj1r7ZuogfSVf5EZK69MxZp0hnMaU1s4JBjPYzAY68wMmt 5hP0SCAb3bbVTn1msWzfusUa8AX38cuxGj/p59NgplppR2DIHCmx3mc3QQLt/0P1KeYJ Dtn/A6shrzS6ReFS1ZJw+au002BhkRMdEqWdPK/FVVx6IViB90t7ySkhwkOOnX+T2NSL pRnh8NUEZnoIsjhx3sInOlrCnZiSMFHcHfapBi8lBe7Ijj1qyfzMpXBxXEupQJiCxnaj L0Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748493623; x=1749098423; 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=5JPEQx1UgA1kK0W1Kyi7k61uvOJ0V0RbXR9RGxgMDm8=; b=EAyCVcyF3ClIKUWdJ6FZEozcIWQL1uHJqKe/GBGgy1IDLaPZksPboA7GM3QZVpVG3a AsZDu8oDwmKbhRmujrSQMAiqk05lQfdeL0fO8SZqGvfoo5I4zY7AKBd7vdfOSf+O5x3o EMM6bECrggmZGICnlxK+b2ojLZFYgjts1p4RSqurFB47JgT4H4b0t0+PqlHkkOFR+36E rKZZ3ee9kwtad0ycJEZ+/OseAEACqUm4Ev1O+UaTyr3wgv4d3IpSl5akrXzAX7CNuEnK q819v3Zz4GXCdL9yntkycw5ZMZa8QxdCwMjefw2CuK/Hr/pSJTJ5kV8VA2dS9swYRegA 5HYw== X-Forwarded-Encrypted: i=1; AJvYcCWyJ8EcSIYMWQrq07yVrJ671AnNfiQhtDQpU4I3dXectypnQCJs9/BORJdSbDGR8uzRPTtJYVdXoF93R6I=@vger.kernel.org X-Gm-Message-State: AOJu0YwtcKgzTzpB89pa46FA92HeIDOiN+oLuwkD2wrIuHqJQjhz14Oi rzO9rAqdMJGtyT0xe+0TdkQ+mbJUAq5ir8dUG/qECYcdOIN4qNh98C1kmLgCk2giTjQ842iDVQp vHOANnUtUeg== X-Google-Smtp-Source: AGHT+IFW4ud+zMcCHcIRcWhv614Og93PmqbrPfMTEVygcvH8Yldeies4S+HKGdGovs+R0RbQObY2hlDVTQ72 X-Received: from pgbcp3.prod.google.com ([2002:a05:6a02:4003:b0:b2c:4287:b413]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:9984:b0:215:de13:e212 with SMTP id adf61e73a8af0-2188c2406a3mr30902424637.15.1748493622489; Wed, 28 May 2025 21:40:22 -0700 (PDT) Date: Wed, 28 May 2025 21:39:44 -0700 In-Reply-To: <20250529044000.759937-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: <20250529044000.759937-1-irogers@google.com> X-Mailer: git-send-email 2.49.0.1204.g71687c7c1d-goog Message-ID: <20250529044000.759937-9-irogers@google.com> Subject: [PATCH v4 08/24] perf jitdump: Directly mark the jitdump DSO 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 , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , "Masami Hiramatsu (Google)" , Ravi Bangoria , Charlie Jenkins , Colin Ian King , Andi Kleen , Dmitry Vyukov , Graham Woodward , Ilkka Koskinen , Zhongqiu Han , Yicong Yang , Athira Rajeev , Kajol Jain , Li Huafei , "Steinar H. Gunderson" , Stephen Brennan , Chun-Tse Shao , Yujie Liu , "Dr. David Alan Gilbert" , Levi Yun , Howard Chu , Weilin Wang , Thomas Falcon , Matt Fleming , Veronika Molnarova , "=?UTF-8?q?Krzysztof=20=C5=81opatowski?=" , Zixian Cai , Steve Clevenger , Ben Gainey , Chaitanya S Prakash , Martin Liska , "=?UTF-8?q?Martin=20Li=C5=A1ka?=" , Song Liu , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The DSO being generated was being accessed through a thread's maps, this is unnecessary as the dso can just be directly found. This avoids problems with passing a NULL evsel which may be inspected to determine properties of a callchain when using the buildid DSO marking code. Signed-off-by: Ian Rogers --- tools/perf/util/jitdump.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c index 624964f01b5f..b062b1f234b6 100644 --- a/tools/perf/util/jitdump.c +++ b/tools/perf/util/jitdump.c @@ -14,9 +14,9 @@ #include #include =20 -#include "build-id.h" #include "event.h" #include "debug.h" +#include "dso.h" #include "evlist.h" #include "namespaces.h" #include "symbol.h" @@ -531,9 +531,22 @@ static int jit_repipe_code_load(struct jit_buf_desc *j= d, union jr_entry *jr) /* * mark dso as use to generate buildid in the header */ - if (!ret) - build_id__mark_dso_hit(tool, event, &sample, NULL, jd->machine); - + if (!ret) { + struct dso_id dso_id =3D { + { + .maj =3D event->mmap2.maj, + .min =3D event->mmap2.min, + .ino =3D event->mmap2.ino, + .ino_generation =3D event->mmap2.ino_generation, + }, + .mmap2_valid =3D true, + .mmap2_ino_generation_valid =3D true, + }; + struct dso *dso =3D machine__findnew_dso_id(jd->machine, filename, &dso_= id); + + if (dso) + dso__set_hit(dso); + } out: perf_sample__exit(&sample); free(event); --=20 2.49.0.1204.g71687c7c1d-goog