Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4672880iob; Sun, 8 May 2022 21:28:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCoHjFhm1PYgS7GBi53TQlTUFvIKwXqvFHp+1NJeUQeQa8hFMDcdpnpT/78+lN91eof7vO X-Received: by 2002:a63:1645:0:b0:3c2:4706:f62b with SMTP id 5-20020a631645000000b003c24706f62bmr11993392pgw.11.1652070483209; Sun, 08 May 2022 21:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652070483; cv=none; d=google.com; s=arc-20160816; b=o5K5Q70R+0OohZH+pYvLgIvVSn64E+4uvYYOmqOEmcmV/2qTGE9p4uSfUHgslldQc7 bsO9CNoJBWyn/HohtFxYsh1hRl8FUNnrKu4USPALQ5j+3TuckLnuVBYNwqjIQSXzDOUc iS2IaaVtFqeN4zC57T0PctAdWvMUaf6e71CTJZiC5Y68YvpSXCclLv27PIjrv/RlLvD5 RdwAgPF2/avZgXcOWUJl8TuWQolwvm1z+QIuDC4uU4psN+QDM/tQCmJfQOFUIaM9yNOi 78zkuV5Ni2Rymwbg2Uj9WtrMhViH2r4qbH737Ms6Jo6LPHbsLDI2tsOkp6qtX+0Z2Uli J29A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fD2NKbHhBWw9eBsTe1mP9moLD1y5EWQbU6ALqfSO3Wk=; b=y2hiWJr15orrNag0h5lx/544z6osJrP1P0ghlX0J1y2SINMH0Ixa9eyAp1CLmWjy50 qxK+aLGT5qQAhk5uoQ5wP6xTtlrqD+1kVeUlQ21yGV1ie73jBPOxm6RZ3Ngp0+Cd+fGi 5QgOEbrImxy4J8cc4G2MNz6MyrdFWefL34BH4SP8XyUMjYsW6G9gX5r9jtXUnv6foKOF hrmd1Z91GspVEk8LONyEcqPNbAIhdmcGsF+9ukPw8TCNtgLhL3FzUeoN1tUewCdX9w4D ck2Rf2qZVnpfYbVPkD9Ch7Zi34g47QfYfJiChnZSCXEuaypZOgXTbNAlHOH46H+oHOxy DMNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Ko5uJ/Cg"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f8-20020a056a001ac800b0051078cc4fd5si14615773pfv.354.2022.05.08.21.28.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 21:28:03 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Ko5uJ/Cg"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 983288930F; Sun, 8 May 2022 21:26:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234590AbiEHPMb (ORCPT + 99 others); Sun, 8 May 2022 11:12:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234437AbiEHPM3 (ORCPT ); Sun, 8 May 2022 11:12:29 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6827BDFA6 for ; Sun, 8 May 2022 08:08:39 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id l7-20020a17090aaa8700b001dd1a5b9965so267786pjq.2 for ; Sun, 08 May 2022 08:08:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=fD2NKbHhBWw9eBsTe1mP9moLD1y5EWQbU6ALqfSO3Wk=; b=Ko5uJ/CgpE5N5MzJuVdoLFcIe/sxyftWIVZjtDxdgeLVWbZWp0M6rPUJPN1+PXytou qAvVZYxAiRj+V6jION1XzQFQPubTbA7zhrctojMA/iDOCSmMf6EMDiFhy/r8V0Q06Pde Z06oGmVf2UEf6ziTvny8IfiLye5VKghQ/36ETPbyo9VfUbNgznX3xLD8eOe+NyJLg/BQ f1rUXK0goNeVvCqA6juraDYy7J39zHYTw+gqLtduxTTAwUAgHCj2e/CEJ7BBV7i5e7ku zocBrpFUOUhuQxNTsLFBh6cLJreZjXAULTTBWeQi6crfiqLZ1RmbA1ww6ax/+LrO/+Mp rxUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fD2NKbHhBWw9eBsTe1mP9moLD1y5EWQbU6ALqfSO3Wk=; b=tI6ZcD0gX6jKPoDi1tX/BjGRdeqacWr/iWttbc9m4n+N1WpYZ2ApkvEPLu2OhM7G0r omSvesCsAOwg9dNNR0zFwO+fy+8nK9E0jkPbYyCgBMVhMr9V4PrDcIIye3wkM3wVDGRO AYC3IkExQceEvvkgBcQhic5Dk6AJNi6GW3noQTIj7gPGabCUsgI0RBTWYkyV60xX8sYJ ETasVZ6o/MdBxwasOJsSn52sXX3mdKa57xZWVBa0DA1UmIEpVeMGAHR17IwlvbyQHndU UWl4ZilpOM29WLqNbXNqh+6QL046l/SJzqJQqJPA0WDVziS2ep9XJQoqYWJ5T8ATj21y Z3RA== X-Gm-Message-State: AOAM531Rs7ZsQlImbB2wzX7v00nU0qeBwdH/vuVitbTCpKwzSBo78CRp Iy2N3C5iUC2vqFwyjCHuLRDkpaohUd/FIPnoFUM= X-Received: by 2002:a17:90a:b307:b0:1bd:37f3:f0fc with SMTP id d7-20020a17090ab30700b001bd37f3f0fcmr22377422pjr.132.1652022518742; Sun, 08 May 2022 08:08:38 -0700 (PDT) Received: from leoy-ThinkPad-X240s (104-237-153-19.ip.linodeusercontent.com. [104.237.153.19]) by smtp.gmail.com with ESMTPSA id c6-20020aa79526000000b0050dc7628155sm6881214pfp.47.2022.05.08.08.08.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 08:08:38 -0700 (PDT) Date: Sun, 8 May 2022 23:08:32 +0800 From: Leo Yan To: Adrian Hunter Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Ian Rogers , Alexey Bayduraev , Namhyung Kim , linux-kernel@vger.kernel.org, James Clark , German Gomez Subject: Re: [PATCH V2 00/23] perf intel-pt: Better support for perf record --cpu Message-ID: <20220508150832.GA278102@leoy-ThinkPad-X240s> References: <20220506122601.367589-1-adrian.hunter@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220506122601.367589-1-adrian.hunter@intel.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Adrian, On Fri, May 06, 2022 at 03:25:38PM +0300, Adrian Hunter wrote: > Hi > > Here are V2 patches to support capturing Intel PT sideband events such as > mmap, task, context switch, text poke etc, on every CPU even when tracing > selected user_requested_cpus. That is, when using the perf record -C or > --cpu option. > > This is needed for: > 1. text poke: a text poke on any CPU affects all CPUs > 2. tracing user space: a user space process can migrate between CPUs so > mmap events that happen on a different CPU can be needed to decode a > user_requested_cpus CPU. > > For example: > > Trace on CPU 1: > > perf record --kcore -C 1 -e intel_pt// & > > Start a task on CPU 0: > > taskset 0x1 testprog & > > Migrate it to CPU 1: > > taskset -p 0x2 > > Stop tracing: > > kill %1 > > Prior to these changes there will be errors decoding testprog > in userspace because the comm and mmap events for testprog will not > have been captured. Thanks a lot for this patch set, I believe this is a common issue for AUX trace (not only for Intel-PT), so I verified this patch set for both Arm CoreSight and SPE; unfortunately both cannot see MMAP events for migrated task. I used below commands: # perf record -B -N --no-bpf-event -e cs_etm//u -C 0 -- taskset --cpu-list 1 uname # perf script --no-itrace --show-mmap-events -C 1 2>/dev/null | grep MMAP | wc -l 0 # perf record -B -N --no-bpf-event -e arm_spe_0//u -C 0 -- taskset --cpu-list 1 uname # perf script --no-itrace --show-mmap-events -C 1 2>/dev/null | grep MMAP | wc -l 0 I didn't dive into details for this patch set, so I cannot say the failure is caused by any issue in this patch set. But it's definitely we need to look into for Arm platforms to root cause what's the reason it cannot record MMAP events properly when migrate tasks. Loop James and German for this reason. Thanks, Leo