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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a1f864b8-d0c1-79d9-f976-64ebec9f3714@arm.com>
Date:   Fri, 27 Jan 2023 15:34:49 +0000
From:   James Clark <james.clark@....com>
To:     Namhyung Kim <namhyung@...nel.org>,
        Adrian Hunter <adrian.hunter@...el.com>
Cc:     Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Ian Rogers <irogers@...gle.com>,
        linux-perf-users@...r.kernel.org, Leo Yan <leo.yan@...aro.org>,
        Stephane Eranian <eranian@...gle.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Jiri Olsa <jolsa@...nel.org>
Subject: Re: [PATCH 3/4] perf session: Avoid calling lseek(2) for pipe



On 27/01/2023 00:19, Namhyung Kim wrote:
> We should not call lseek(2) for pipes as it won't work.  And we already
> in the proper place to read the data for AUXTRACE.  Add the comment like
> in the PERF_RECORD_HEADER_TRACING_DATA.
> 
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> ---
>  tools/perf/util/session.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
> index 7c021c6cedb9..fdfe772f2699 100644
> --- a/tools/perf/util/session.c
> +++ b/tools/perf/util/session.c
> @@ -1699,8 +1699,13 @@ static s64 perf_session__process_user_event(struct perf_session *session,
>  	case PERF_RECORD_AUXTRACE_INFO:
>  		return tool->auxtrace_info(session, event);
>  	case PERF_RECORD_AUXTRACE:
> -		/* setup for reading amidst mmap */
> -		lseek(fd, file_offset + event->header.size, SEEK_SET);
> +		/*
> +		 * Setup for reading amidst mmap, but only when we
> +		 * are in 'file' mode.  The 'pipe' fd is in proper
> +		 * place already.
> +		 */
> +		if (!perf_data__is_pipe(session->data))
> +			lseek(fd, file_offset + event->header.size, SEEK_SET);

I'm not sure if it means anything, but Arm SPE works both with and
without this change, although I did have to skip the build-id inject part:

  perf record -o- -e arm_spe// stress -c 1 -t 1 | \
    perf report -i- --itrace=i1000


>  		return tool->auxtrace(session, event);
>  	case PERF_RECORD_AUXTRACE_ERROR:
>  		perf_session__auxtrace_error_inc(session, event);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ