Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp174680pxk; Wed, 30 Sep 2020 22:29:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjtq6w7Ri3Wmh5O8BNTWlMnbkDe0zSx9DFoPOh59L056FIDGzjXNGLSfTEtN4hjjmYNUIj X-Received: by 2002:a50:fe82:: with SMTP id d2mr6187639edt.86.1601530146531; Wed, 30 Sep 2020 22:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601530146; cv=none; d=google.com; s=arc-20160816; b=boag8qrU0gqSUWf5/8gywqepiJu3Q8vWm+i+3Z7VmOYID7zN95/TRuBUALLTCj/8a5 lMCWQuOLvBMg03sA+Da/LTPZIQS0dUjMA7zvcjAAIf7uEDaFqUquMLDzp4uLJPI/YpJq 44f5Ow6POMMMUryrsE1LNzu1JnCftXj3I9dC9TaHSVNbgD6iqprgjnUepDWdmOSDcg3M WEKYPRiBMSQ4YGiqJKv3hVy0GLwdtYpzkoNEW3TJ+ZpdkyxnVsQkOkFovOEMYV0/BxD7 2GoOb9ee2hpvN3SVh2Htjoo9G2eGrh0t+wbhskKgoTY68TAMtSu+Vj93XtHeCHzmvkj3 3XEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Jpd2RJeN3d71IAidBHSzwzFJ1Qeh1n4bsmrYv1z5vsQ=; b=SfxKGsJs05ZgjN3w7Ay5jOZByURsAsZHD0uMkElo1nQEpUk4bHCMNgwy/vrM/SKZq6 4LN2/vup97YwcSjKZnQWY8Hi+Md/1awTLENtNIpWdJnd6vZgePf2w7IS8fFJLRoxOvCW /VmofnUJHfLlbKezTtYqJooQdVW3D2LcUkOviPhWuLLKGbocFxJmOCAsGY8kVAeaK+BU tmbIJUxh/ges4VeO+ccsdcGrc+8zkVJuQkVGwwWFyYQdokaSGOFuK3RIyoJ0/vOcT31N elp1mPKHn0NO68/tezN8RZ06CA8ijbhlTVEh7TEEGHErHW3lMoWZm2Dyf4d8TOvRS7n7 XMgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CoDGrl0B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id w2si2709865edt.253.2020.09.30.22.28.43; Wed, 30 Sep 2020 22:29:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CoDGrl0B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1725960AbgJAFZa (ORCPT + 99 others); Thu, 1 Oct 2020 01:25:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725878AbgJAFZa (ORCPT ); Thu, 1 Oct 2020 01:25:30 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D46DFC061755 for ; Wed, 30 Sep 2020 22:25:28 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id z1so4115831wrt.3 for ; Wed, 30 Sep 2020 22:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Jpd2RJeN3d71IAidBHSzwzFJ1Qeh1n4bsmrYv1z5vsQ=; b=CoDGrl0BWpn9DUGkm7cYagxRmOc/Y8IgRDkTncdyHjJ+sElpnQTh7YjAAcRXavbGTd U7OE+Pu1Gc93ul02IniXFTM95Xz02rpV7XypJH57of5Id9iCBQ6GR2Bq7e8Xu7gQDF0b G6lrUjPc1NFW4zZCnFB5x6MuuW4nJPCgfxLu5UAFjAXtROdBjMVU87KjRgrWsW9sNFSV dfulNhHYnsu5AgDtiPpC3OEVu4TSjTZHBSuLSFvA+N0GRru9DNm8EA7z79opUDknLERb nizIW6QG2V9tnNtIH0xJvKk3Q67Eenw0P0cUJsPrE+jJF0qzwnggrxuHH6j2v2vefwQi oPNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Jpd2RJeN3d71IAidBHSzwzFJ1Qeh1n4bsmrYv1z5vsQ=; b=boMCxGUHCjggvsRHQBLnHn58N6b7+s3Mu/kskoeUk2sZfBY2DwIMGpAc2e19aYxDWN ACSAJkCcozXeMfeoZSbqCTgeGvU9+2BlhEQyF871Sihjq5MTHVyLXB0q+uhkl6O5nYHu JezjNyLj/Lo2GHTCbEGk3FWyQVLNFmeWISlzBLWk8CLnJ6/56aiprE709hm6f5P0UzQK iDkIgTdI+RDwcIo9ln7MyMGdqvpOlb0WFrU+z2tuWDFwhEngFBk85F0sfM1REhqROYdv UO5O3RdtseSh0g6tIexgB5MZ3KmtWQDMoXDmSv/bOXbyGrA4QZCeQYg9os56Fk5JEFbS HXIg== X-Gm-Message-State: AOAM530ZsuzORRbhiV7jrkrOlEu7KsY45XSnClkQ7loepPXplyXMxSsi rzPtnF7ZwpfZF/BNumDTGlMnfLrP16D48ESftFY0zWYz6xS4Qg== X-Received: by 2002:adf:f5c1:: with SMTP id k1mr7127914wrp.271.1601529927292; Wed, 30 Sep 2020 22:25:27 -0700 (PDT) MIME-Version: 1.0 References: <20200930171512.3986425-1-jolsa@kernel.org> <20200930171512.3986425-7-jolsa@kernel.org> In-Reply-To: <20200930171512.3986425-7-jolsa@kernel.org> From: Ian Rogers Date: Wed, 30 Sep 2020 22:25:16 -0700 Message-ID: Subject: Re: [PATCH 6/9] perf tools: Pass build_id object to dso__set_build_id To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Namhyung Kim , Alexander Shishkin , Michael Petlan , Stephane Eranian Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 30, 2020 at 10:15 AM Jiri Olsa wrote: > > Passing build_id object to dso__set_build_id, so it's easier > to initialize dos's build id object. > > Signed-off-by: Jiri Olsa Acked-by: Ian Rogers Thanks, Ian > --- > tools/perf/util/dso.c | 4 ++-- > tools/perf/util/dso.h | 2 +- > tools/perf/util/header.c | 4 +++- > tools/perf/util/symbol-minimal.c | 2 +- > tools/perf/util/symbol.c | 2 +- > 5 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c > index 2f7f01ead9a1..4415ce83150b 100644 > --- a/tools/perf/util/dso.c > +++ b/tools/perf/util/dso.c > @@ -1326,9 +1326,9 @@ void dso__put(struct dso *dso) > dso__delete(dso); > } > > -void dso__set_build_id(struct dso *dso, void *build_id) > +void dso__set_build_id(struct dso *dso, struct build_id *bid) > { > - memcpy(dso->bid.data, build_id, sizeof(dso->bid.data)); > + dso->bid = *bid; > dso->has_build_id = 1; > } > > diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h > index eac004210b47..5a5678dbdaa5 100644 > --- a/tools/perf/util/dso.h > +++ b/tools/perf/util/dso.h > @@ -260,7 +260,7 @@ bool dso__sorted_by_name(const struct dso *dso); > void dso__set_sorted_by_name(struct dso *dso); > void dso__sort_by_name(struct dso *dso); > > -void dso__set_build_id(struct dso *dso, void *build_id); > +void dso__set_build_id(struct dso *dso, struct build_id *bid); > bool dso__build_id_equal(const struct dso *dso, u8 *build_id); > void dso__read_running_kernel_build_id(struct dso *dso, > struct machine *machine); > diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c > index fe220f01fc94..21243adbb9fd 100644 > --- a/tools/perf/util/header.c > +++ b/tools/perf/util/header.c > @@ -2082,8 +2082,10 @@ static int __event_process_build_id(struct perf_record_header_build_id *bev, > dso = machine__findnew_dso(machine, filename); > if (dso != NULL) { > char sbuild_id[SBUILD_ID_SIZE]; > + struct build_id bid; > > - dso__set_build_id(dso, &bev->build_id); > + build_id__init(&bid, bev->build_id, BUILD_ID_SIZE); > + dso__set_build_id(dso, &bid); > > if (dso_space != DSO_SPACE__USER) { > struct kmod_path m = { .name = NULL, }; > diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c > index dba6b9e5d64e..f9eb0bee7f15 100644 > --- a/tools/perf/util/symbol-minimal.c > +++ b/tools/perf/util/symbol-minimal.c > @@ -349,7 +349,7 @@ int dso__load_sym(struct dso *dso, struct map *map __maybe_unused, > dso->is_64_bit = ret; > > if (filename__read_build_id(ss->name, &bid) > 0) > - dso__set_build_id(dso, bid.data); > + dso__set_build_id(dso, &bid); > return 0; > } > > diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c > index 369cbad09f0d..976632d0baa0 100644 > --- a/tools/perf/util/symbol.c > +++ b/tools/perf/util/symbol.c > @@ -1818,7 +1818,7 @@ int dso__load(struct dso *dso, struct map *map) > is_regular_file(dso->long_name)) { > __symbol__join_symfs(name, PATH_MAX, dso->long_name); > if (filename__read_build_id(name, &bid) > 0) > - dso__set_build_id(dso, bid.data); > + dso__set_build_id(dso, &bid); > } > > /* > -- > 2.26.2 >