Re: [PATCH v2 bpf-next] selftests/bpf: Add benchmark for local_storage RCU Tasks Trace usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 28, 2022 at 07:12:00AM -0700, Dave Marchevsky wrote:
[ ... ]
> +static void local_storage_tasks_trace_setup(void)
> +{
> +	int i, err, forkret, runner_pid;
> +
> +	runner_pid = getpid();
> +
> +	for (i = 0; i < args.nr_procs; i++) {
> +		forkret = fork();
> +		if (forkret < 0) {
> +			fprintf(stderr, "Error forking sleeper proc %u of %u, exiting\n", i,
> +				args.nr_procs);
> +			goto err_out;
> +		}
> +
> +		if (!forkret) {
> +			err = prctl(PR_SET_PDEATHSIG, SIGKILL);
neat.

> +			if (err < 0) {
> +				fprintf(stderr, "prctl failed with err %d, exiting\n", err);
s/err/errno/

> +				goto err_out;
> +			}
> +
> +			if (getppid() != runner_pid) {
> +				fprintf(stderr, "Runner died while spinning up procs, exiting\n");
> +				goto err_out;
> +			}
> +			sleep_and_loop();
> +		}
> +	}
> +	fprintf(stderr, "Spun up %u procs (our pid %d)\n", args.nr_procs, runner_pid);
nit. shouldn't print to stderr.

Acked-by: Martin KaFai Lau <kafai@xxxxxx>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux