Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp317076rwn; Wed, 7 Sep 2022 17:27:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR4PqZ/SUS0CN9Av+ds77SPPRpjxkkJuvABgdqFU47gjSOxfS/t3uOa4kMZOeLOanbA7VJB4 X-Received: by 2002:a17:90b:3e81:b0:1fd:8357:cbc8 with SMTP id rj1-20020a17090b3e8100b001fd8357cbc8mr1262702pjb.48.1662596849244; Wed, 07 Sep 2022 17:27:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662596849; cv=none; d=google.com; s=arc-20160816; b=BToRRBknbQsMoxs5tR94YMd/t1drHYb8bsjfo8gpj6IIdjEus/vcm+lJlsTYPj5DKd HNuHMNyXC8FUG0QSBvfuN2OmW/7PRi47e8LyCxQBs3vhtiH3MDHiMHWDDuxks0HGsF9n M8RRfCX+S0M6nF+icWTaQDeodK3dl1deR7G6+HSZwj5YO1BJs1TqrENHEK3QwFG/u9fx z5+/wKtDvwPeKSobyUjVGn3WYENxA/6VdjTA1Ytx3DBjzJRrian0y9T4AthA7zF+0BnQ p6mjo2WcX6drL7PhCG772/kIITTRlvqx3c9wdUXOKXT9kyYRAOfL3fYnMiATL4+MIpOL hyXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:references:in-reply-to:user-agent:subject:cc:to:from :date:dkim-signature; bh=w1jsb9wOLkTivNg7H4Hec7LMmj4ViVYdB0XbI1tSz6Q=; b=AwOcvv40IKyFiazw9mllORFj7rPryG+6PHRt+o9b8TLMvPbOEiASpQdA7p3hTNSVtm oIPfHFZHFypJRaf/cJ+hX0wotpvAmUHDWyI9sLs4n/yxG3CusyIZB7Rjxm7Z5fjgKrwE O36DLnrsO45I1Rfa/2xl8MZLAcs6xSv1fVutr53Pj2sQNGwhDaSsU1BI5TIfltLO6E6u ap54y7TPEcH253utNm/qJaamQyphU8yKYgYYFlutDu0aNCAjSYRH0unCJTE8xCTP00V4 /WnO5qkRNxbYt7g3OwOa1x2SHxruJ7vdaTPhJpPt8NfCecqxFKYYzCA90XkqSYC8iTf4 Jc6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YRQVcKMb; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p1-20020a654901000000b0042b31fdb2d1si18551421pgs.208.2022.09.07.17.27.17; Wed, 07 Sep 2022 17:27:29 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=YRQVcKMb; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230005AbiIGXsD (ORCPT + 99 others); Wed, 7 Sep 2022 19:48:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbiIGXsB (ORCPT ); Wed, 7 Sep 2022 19:48:01 -0400 Received: from mail-oa1-x2a.google.com (mail-oa1-x2a.google.com [IPv6:2001:4860:4864:20::2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03E9CA7ABD; Wed, 7 Sep 2022 16:48:01 -0700 (PDT) Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-127dca21a7dso12746242fac.12; Wed, 07 Sep 2022 16:48:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:to:from:date:from:to:cc:subject :date; bh=w1jsb9wOLkTivNg7H4Hec7LMmj4ViVYdB0XbI1tSz6Q=; b=YRQVcKMby3Lds4fI1dduM5cnu84BBJmqE+V/8aoNSsKHyJUvL3NSmRNZktPhQk1CA+ 1rhFzop7CfNMnPjf8jsb0zQIkyYvQyZa2aQ7Jz7a3VLwGyzXl2/VDk1QKwu1JrCrCuTJ R1HdxuEGGk1/2j508/saF+5jSg+UEy2yZv6cEnVImDYJvHx7sg0wm6ewRqWBzpZ+hAmO nwzixxJ7JxIvI7qI1RVAI66UKySJJPJP2/cK+yeUwDYCYxotEyZ4gaXyTgm09VbKI3Nq CkxlP61i7lOgiMmUppwzNFw/Jw/UIYW/KfBualPJ1UbCWKQVvlVwVw5JPsEbPV0Wq0Yw Ugtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date; bh=w1jsb9wOLkTivNg7H4Hec7LMmj4ViVYdB0XbI1tSz6Q=; b=P9b8u0IdN4c8xH9GxNBvZX5KKpsj3972dzV9QMhrUEnQiZTSRHHONFLKP24rk06diC 3o9gGPTWuJk32ZyqHhJ9pvVecgZJVS6UoHrEfwhOXVDeMxkR5Mua7IMymrlE6UnKdiR0 pDJdvCubuSGupWjXaaZ1IE8UJ1Db5vXShifoOAWNNZ496x9JSSCPFSr22dfMB0iFm3O4 dvzgeljtO5mpZzAHXJ7bKcoCoaaNK158iyfAwU7n6aVpXl8sDC9hooGDCm1LGHb1rxt7 UUfAITJSrevB9seBeN4mVAFxhPEUV19Li/FDjZ76KG97DY/e2y99FoS+y8uuJDRdBRYi NPvg== X-Gm-Message-State: ACgBeo0p5usGW+pActuYNbrCh57zATfFyu0gyE2Ws/N/Yjwdb6REAvA+ iBwTfMH1azzRN+X9nfc4ghM= X-Received: by 2002:aca:2109:0:b0:345:7ad9:dbb5 with SMTP id 9-20020aca2109000000b003457ad9dbb5mr370923oiz.66.1662594480279; Wed, 07 Sep 2022 16:48:00 -0700 (PDT) Received: from [127.0.0.1] ([179.97.37.151]) by smtp.gmail.com with ESMTPSA id w62-20020acaad41000000b0034516ca90dcsm6943533oie.23.2022.09.07.16.47.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Sep 2022 16:47:59 -0700 (PDT) Date: Wed, 07 Sep 2022 20:47:52 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers , Jiri Olsa CC: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Namhyung Kim , James Clark , Kees Cook , "Gustavo A. R. Silva" , Adrian Hunter , Riccardo Mancini , German Gomez , Colin Ian King , Song Liu , Dave Marchevsky , Athira Rajeev , Alexey Bayduraev , Leo Yan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Stephane Eranian Subject: Re: [PATCH v2 6/6] perf cpumap: Add range data encoding User-Agent: K-9 Mail for Android In-Reply-To: References: <20220614143353.1559597-1-irogers@google.com> <20220614143353.1559597-7-irogers@google.com> Message-ID: <9B5AEBE0-D000-4D58-94BA-85153C5CD66F@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 September 7, 2022 7:41:19 PM GMT-03:00, Ian Rogers wrote: >On Thu, Aug 4, 2022 at 12:30 PM Ian Rogers wrote: >> >> On Sun, Jul 31, 2022 at 5:39 AM Jiri Olsa wrote: >> > >> > On Tue, Jun 14, 2022 at 07:33:53AM -0700, Ian Rogers wrote: >> > >> > SNIP >> > >> > > + event =3D cpu_map_data__alloc(&syn_data, sizeof(struct perf_e= vent_header)); >> > > if (!event) >> > > return NULL; >> > > >> > > + syn_data=2Edata =3D &event->data; >> > > event->header=2Etype =3D PERF_RECORD_CPU_MAP; >> > > - event->header=2Esize =3D size; >> > > - event->data=2Etype =3D type; >> > > - >> > > - cpu_map_data__synthesize(&event->data, map, type, max); >> > > + event->header=2Esize =3D syn_data=2Esize; >> > > + cpu_map_data__synthesize(&syn_data); >> > > return event; >> > > } >> > > >> > > + >> > > int perf_event__synthesize_cpu_map(struct perf_tool *tool, >> > > const struct perf_cpu_map *map, >> > > perf_event__handler_t process, >> > > @@ -1891,24 +1894,20 @@ int perf_event__synthesize_event_update_nam= e(struct perf_tool *tool, struct evse >> > > int perf_event__synthesize_event_update_cpus(struct perf_tool *too= l, struct evsel *evsel, >> > > perf_event__handler_t pr= ocess) >> > > { >> > > - size_t size =3D sizeof(struct perf_event_header) + sizeof(u64= ) + sizeof(u64); >> > > + struct synthesize_cpu_map_data syn_data =3D { =2Emap =3D evse= l->core=2Eown_cpus }; >> > > struct perf_record_event_update *ev; >> > > - int max, err; >> > > - u16 type; >> > > - >> > > - if (!evsel->core=2Eown_cpus) >> > > - return 0; >> > >> > all seems fine, just looks like we no longer do this check, >> > might not be needed anymore, as that changed in past >> >> This function is called in a test and in this file=2E The caller alread= y >> does this test and so the check is redundant plus a little confusing: >> https://git=2Ekernel=2Eorg/pub/scm/linux/kernel/git/acme/linux=2Egit/tr= ee/tools/perf/util/synthetic-events=2Ec?h=3Dperf/core#n2062 >> As you say, it wasn't needed any more and so I removed it=2E >> >> Thanks, >> Ian > >Would be nice to land this imo=2E Anything outstanding? I'll check first hour tomorrow, today was a holiday down here=2E - Arnaldo > >Thanks, >Ian > >> > thanks, >> > jirka >> > >> > > + int err; >> > > >> > > - ev =3D cpu_map_data__alloc(evsel->core=2Eown_cpus, &size, &ty= pe, &max); >> > > + ev =3D cpu_map_data__alloc(&syn_data, sizeof(struct perf_even= t_header) + 2 * sizeof(u64)); >> > > if (!ev) >> > > return -ENOMEM; >> > > >> > > + syn_data=2Edata =3D &ev->cpus=2Ecpus; >> > > ev->header=2Etype =3D PERF_RECORD_EVENT_UPDATE; >> > > - ev->header=2Esize =3D (u16)size; >> > > + ev->header=2Esize =3D (u16)syn_data=2Esize; >> > > ev->type =3D PERF_EVENT_UPDATE__CPUS; >> > > ev->id =3D evsel->core=2Eid[0]; >> > > - >> > > - cpu_map_data__synthesize(&ev->cpus=2Ecpus, evsel->core=2Eown_= cpus, type, max); >> > > + cpu_map_data__synthesize(&syn_data); >> > > >> > > err =3D process(tool, (union perf_event *)ev, NULL, NULL); >> > > free(ev); >> > > -- >> > > 2=2E36=2E1=2E476=2Eg0c4daa206d-goog >> > >