Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4590395pxj; Wed, 12 May 2021 08:49:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx38EufG67eHJ4S8i3Q0UIih9HyPInLvwq/zzRH7CBo+xZW9bUwHxDks5y/wpyDel/KQeym X-Received: by 2002:aa7:d90b:: with SMTP id a11mr44131715edr.273.1620834550379; Wed, 12 May 2021 08:49:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620834550; cv=none; d=google.com; s=arc-20160816; b=Zp7vDXL2zJsLxx93oe8Nm4tM/6ofWAFJqiUb45qq0gTwt/mDp6tnRqFV15sB4q2u+S qZkkhSOzCGgvYvB/lv4cKFkys3fznacLK/yXI41BQQSyjbhI5E22HdGjHBqpgQw0lzMW ERZehOqGQUCibc8ijqUOtL/fkMi7gBk6JjLalFLqVrec2nM6QR8gN6VG8iyjmF2TlZAv 4foGD9SLhA/bt3xGkj9fem8uj5/z+cEHwrUUTgbCGFFYiPrpVGdFqFZBTqCkIII5ogeX F+7tI0j0ir0nMHLjNOwdRzqmLbkbuFjtIr0IYaMwrVy4GEQAJ/66SlcF/LkMFHs/w2sJ GP6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:to :from:subject; bh=RM5VoUK9Cvr8hLGXHvagqDdnirI+hFTTtHLZ97C71ag=; b=N07V9AsZFc+7D/h9pBO016MSxMDFAdBdtbhAvUyfV/u0U9iJt6N16wHV0V5PQbHAHi pDFplPgn/RC3183B1NfHq5B44B9zgl3t4j2Uewh81i7vSxbMDsW/cI/5jaseFqQWYcy4 cXbF/o3oxgDox4lsA5zNz6oQZ833XUi5BPE49/b6SrDCuWvtt/0IPnEgGXmiJwlYuuzR Sk9bcJekxQhUdxpvAPnJRcsj9qIwxLD5y36pwkqzkImRl04/WbCrEJR2RfOhfYu7LXUE jHIfg3loo0OcnidI8H069lDFXUD+aRNroEuTjWdP64skFHVMPqXg+gvH8oC7EYzX2zFq YazQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga17si244607ejb.144.2021.05.12.08.48.45; Wed, 12 May 2021 08:49:10 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236540AbhELPkt (ORCPT + 99 others); Wed, 12 May 2021 11:40:49 -0400 Received: from foss.arm.com ([217.140.110.172]:41812 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233409AbhELPSQ (ORCPT ); Wed, 12 May 2021 11:18:16 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9CE2D31B; Wed, 12 May 2021 08:17:06 -0700 (PDT) Received: from [10.57.81.122] (unknown [10.57.81.122]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4E2DA3F718; Wed, 12 May 2021 08:17:04 -0700 (PDT) Subject: Re: [PATCH v1 2/3] perf arm-spe: Correct sample flags for dummy event From: James Clark To: Leo Yan , Arnaldo Carvalho de Melo , John Garry , Will Deacon , Mathieu Poirier , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Al Grant References: <20210429150100.282180-1-leo.yan@linaro.org> <20210429150100.282180-3-leo.yan@linaro.org> Message-ID: <95d93dcb-e930-a1c7-08e1-be8885d19f64@arm.com> Date: Wed, 12 May 2021 18:17:03 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/05/2021 17:39, James Clark wrote: > > > On 29/04/2021 18:00, Leo Yan wrote: >> The dummy event is mainly used for mmap, the TIME sample is only needed [...] >> - tracking_evsel->core.attr.freq = 0; >> - tracking_evsel->core.attr.sample_period = 1; >> - evsel__set_sample_bit(tracking_evsel, TIME); >> - evsel__set_sample_bit(tracking_evsel, CPU); >> - evsel__reset_sample_bit(tracking_evsel, BRANCH_STACK); >> + if (opts->full_auxtrace) { >> + struct evsel *tracking_evsel; > > Hi Leo, > > I know the "if (opts->full_auxtrace)" pattern is copied from other auxtrace > files, but I don't think it does anything because there is this at the top > of the function: > > if (!opts->full_auxtrace) > return 0; > > The same applies for other usages of "full_auxtrace" in the same function. > They are all always true. I'm also not sure if it's ever defined what > full_auxtrace means. > > James Apart from this issue above, I've tested the full patchset with various combinations of --per-thread, -a and --timestamp and don't see any issues like missing command names or decode issues. (Apart from -a where Command is reported as '-1', but this issue is present before and after this patchset so is unrelated.) I think it makes sense to unify the behaviour to make it more like Coresight and others so this is a good change. Reviewed-by: James Clark Tested-by: James Clark > >> + >> + err = parse_events(evlist, "dummy:u", NULL); >> + if (err) >> + return err; >> + >> + tracking_evsel = evlist__last(evlist); >> + evlist__set_tracking_event(evlist, tracking_evsel); >> + >> + tracking_evsel->core.attr.freq = 0; >> + tracking_evsel->core.attr.sample_period = 1; >> + >> + /* In per-cpu case, always need the time of mmap events etc */ >> + if (!perf_cpu_map__empty(cpus)) >> + evsel__set_sample_bit(tracking_evsel, TIME); >> + } >> >> return 0; >> } >>