lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230905013214.GE114383@leoy-huanghe>
Date:   Tue, 5 Sep 2023 09:33:38 +0800
From:   Leo Yan <leo.yan@...aro.org>
To:     James Clark <james.clark@....com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        Mike Leach <mike.leach@...aro.org>,
        John Garry <john.g.garry@...cle.com>,
        Will Deacon <will@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Ian Rogers <irogers@...gle.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        coresight@...ts.linaro.org, linux-arm-kernel@...ts.infradead.org,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 1/2] perf cs-etm: Validate timestamp tracing in
 per-thread mode

On Mon, Sep 04, 2023 at 04:23:43PM +0100, James Clark wrote:
> 
> On 27/08/2023 14:35, Leo Yan wrote:
> > So far, it's impossible to validate timestamp trace in Arm CoreSight when
> > the perf is in the per-thread mode.  E.g. for the command:
> > 
> >   perf record -e cs_etm/timestamp/ --per-thread -- ls
> > 
> > The command enables config 'timestamp' for 'cs_etm' event in the
> > per-thread mode.  In this case, the function cs_etm_validate_config()
> > directly bails out and skips validation.
> > 
> > Given profiled process can be scheduled on any CPUs in the per-thread
> > mode, this patch validates timestamp tracing for all CPUs when detect
> > the CPU map is empty.
> 
> There is an edge case where the profiled process is known by the user to
> be pinned to a specific CPU, rather than possibly running on all CPUs,
> so this isn't always true.

Good point.

However, when a process is pinned to specific CPUs, we still can
dynamically change the scheduling affinity to any other CPUs by using
taskset command or calling sched_setaffinity().  From a perf session's
pespective, it is sane to validate timestamp tracing for all online
CPUs for per-thread mode.

> But I think that can be worked around by changing it to a per-cpu
> session to get around the new error. Given that this validation was only
> supposed to be best effort information and not get in the way you could
> say to not make it more restrictive.
> 
> But it's quite a small edge case so either way:
> 
> Reviewed-by: James Clark <james.clark@....com>

Thanks for review!

Leo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ