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] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 11 Jul 2021 17:44:04 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Namhyung Kim <namhyung@...nel.org>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Andi Kleen <ak@...ux.intel.com>,
        Ian Rogers <irogers@...gle.com>,
        Adrian Hunter <adrian.hunter@...el.com>
Subject: Re: [PATCH 4/4] perf inject: Fix output from a file to a pipe

On Wed, Jul 07, 2021 at 11:05:36AM -0700, Namhyung Kim wrote:

SNIP

> +	if (!data.is_pipe && inject.output.is_pipe) {
> +		ret = perf_header__write_pipe(perf_data__fd(&inject.output));
> +		if (ret < 0) {
> +			pr_err("Couldn't write a new pipe header.\n");
> +			goto out_delete;
> +		}
> +
> +		ret = perf_event__synthesize_attrs(&inject.tool,
> +						   inject.session->evlist,
> +						   perf_event__repipe);
> +		if (ret < 0) {
> +			pr_err("Couldn't inject synthesized attrs.\n");
> +			goto out_delete;
> +		}
> +
> +		ret = perf_event__synthesize_features(&inject.tool,
> +						      inject.session,
> +						      inject.session->evlist,
> +						      perf_event__repipe);
> +		if (ret < 0) {
> +			pr_err("Couldn't inject synthesized features.\n");
> +			goto out_delete;
> +		}
> +
> +		if (have_tracepoints(&inject.session->evlist->core.entries)) {
> +			/*
> +			 * FIXME err <= 0 here actually means that
> +			 * there were no tracepoints so its not really
> +			 * an error, just that we don't need to
> +			 * synthesize anything.  We really have to
> +			 * return this more properly and also
> +			 * propagate errors that now are calling die()
> +			 */
> +			ret = perf_event__synthesize_tracing_data(&inject.tool,
> +						perf_data__fd(&inject.output),
> +						inject.session->evlist,
> +						perf_event__repipe);
> +			if (ret <= 0) {
> +				pr_err("Couldn't inject tracing data.\n");
> +				goto out_delete;
> +			}
> +		}
> +	}

hum.. how bad (too many args?) would be to put this to some function
in util/record.c, because it's copied directly from builtin-record.c

jirka

> +
>  	if (inject.build_ids && !inject.build_id_all) {
>  		/*
>  		 * to make sure the mmap records are ordered correctly
> -- 
> 2.32.0.93.g670b81a890-goog
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ