Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3911095rwb; Mon, 21 Nov 2022 00:54:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf5EpQ8raPHv0j4cJJiNhU/ybsItuZEVizUujEgAnUllTIQ9cZAPQS9asI1WB6EG2ALF8r87 X-Received: by 2002:a17:906:b88b:b0:7b5:8550:92ee with SMTP id hb11-20020a170906b88b00b007b5855092eemr4590149ejb.382.1669020879124; Mon, 21 Nov 2022 00:54:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669020879; cv=none; d=google.com; s=arc-20160816; b=e7QOjdjiriWfaMqzpMgOPQOnY8PGkn2EU9MGgDdJCeDw0jZKjmi7gaGCaNTH0KbbU7 WdSx6M8OO5JFrQI2konOoVp1WHzad5/x1Nf1DZ3NtXWB4m/izv5hmKDMdRDxUCwfRRpb tbSUX08pOCFBXhZZt9tZa15S0EbbFifvJiM2etOKdFB6Vcjm0B6/p2Gf2YlMuzStIHrh qcONTNlycFRWDLNg2y1e5xOPro8/1Xfmp73NpU8vqjTqjJdZI+WIB9glic4IWvoiU5CT S5SmrWu+Nns0l4sS6pF5or2RucIRE2DjXeqZcU7kIUq8zgl88+5S+A7V+ROFxPyV0ezF 5FLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=LO74SIiczTx4wfnvUlwm+6iyg+TnwcaV9AjQKUM58yw=; b=PQzjrl5TzhaU+1jrFgKVirLAPGHnGPdWFjgeFpIsXv4uhOJPfqAjgjZl7gFSiB4mg6 z3ArY6G7oWc7jLgeaPZFgrmV6L+Nzh0mtc0TcdUQV6vSlto66nEPF9Z+IlMx1VZHDy/D IF0MWntxY8FYwyd4HPTkVIk4cgdhVUYjsaeo9o23ZGeYm7mEidW6m8vpy+Ho48l3UK2L fWJVvxlMhKUsI6ijgH3gFmChZWYdZjm0KGoBW1UeZ27eBMFRUfoUlygjx/c1xHfpswsI 3RqSsN0UJdpUuNSDn3WUc7ZnQeXvylNJZX0CY35KKyrQgtYRr0GA9IpmTT4xHDR9uyH9 jg6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CJGtNDAF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t1-20020a056402524100b00461f7a7a797si9582314edd.292.2022.11.21.00.54.16; Mon, 21 Nov 2022 00:54:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CJGtNDAF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230167AbiKUIp3 (ORCPT + 91 others); Mon, 21 Nov 2022 03:45:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230156AbiKUIpY (ORCPT ); Mon, 21 Nov 2022 03:45:24 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 634B97EBEF; Mon, 21 Nov 2022 00:45:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669020320; x=1700556320; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=RDUUSENrZBWktghAjmuOUPhABNfGjIGLGX0RlGyUMgg=; b=CJGtNDAFm0AKtErdydpW2yRY/P9ZwmOxoHijqaa9Fmh7/9x3wWnD/9gp MQzq4vV0I8MoheLfF+S8/WqdyxeMz9WJ9O7NcTR0nfnTxeF+gDO3vK9en bNL+kTesxYlQosigwK53oAEaHYWdqJU5mqBsj9f/RcD40opZDFilqZeQB JYkCc+RDiknA9Dmt5flxOa5dAeewusKmOhZ0zVuezWG4DY5xztAzXIGd8 FDv32RJezX89fSUAiojCTOQ+hyR3PJAvn9WjhnR6lXZX1mgzrwb/qPBkV cyKYtK5yzPhC7dOCn5pYD3RWv4C07hn1F/Vjz7uwYz4pyNAfIAW0nh2VY g==; X-IronPort-AV: E=McAfee;i="6500,9779,10537"; a="314654321" X-IronPort-AV: E=Sophos;i="5.96,180,1665471600"; d="scan'208";a="314654321" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2022 00:45:20 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10537"; a="635110094" X-IronPort-AV: E=Sophos;i="5.96,180,1665471600"; d="scan'208";a="635110094" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.35.94]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2022 00:45:17 -0800 Message-ID: <5e408880-3394-c943-6ed5-6ceb8d05fd07@intel.com> Date: Mon, 21 Nov 2022 10:45:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.5.0 Subject: Re: [PATCH] perf inject: Set PERF_RECORD_MISC_BUILD_ID_SIZE Content-Language: en-US To: Namhyung Kim , Arnaldo Carvalho de Melo , Jiri Olsa Cc: Ingo Molnar , Peter Zijlstra , LKML , Ian Rogers , linux-perf-users@vger.kernel.org References: <20221119002750.1568027-1-namhyung@kernel.org> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <20221119002750.1568027-1-namhyung@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/11/22 02:27, Namhyung Kim wrote: > With perf inject -b, it synthesizes build-id event for DSOs. But it > missed to set the size and resulted in having trailing zeros. > > As perf record sets the size in write_build_id(), let's set the size > here as well. > > Signed-off-by: Namhyung Kim Acked-by: Adrian Hunter > --- > tools/perf/util/synthetic-events.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c > index cccd293b5312..0645795ff080 100644 > --- a/tools/perf/util/synthetic-events.c > +++ b/tools/perf/util/synthetic-events.c > @@ -2218,8 +2218,9 @@ int perf_event__synthesize_build_id(struct perf_tool *tool, struct dso *pos, u16 > len = pos->long_name_len + 1; > len = PERF_ALIGN(len, NAME_ALIGN); > memcpy(&ev.build_id.build_id, pos->bid.data, sizeof(pos->bid.data)); > + ev.build_id.size = pos->bid.size; > ev.build_id.header.type = PERF_RECORD_HEADER_BUILD_ID; > - ev.build_id.header.misc = misc; > + ev.build_id.header.misc = misc | PERF_RECORD_MISC_BUILD_ID_SIZE; > ev.build_id.pid = machine->pid; > ev.build_id.header.size = sizeof(ev.build_id) + len; > memcpy(&ev.build_id.filename, pos->long_name, pos->long_name_len);