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:	Tue, 7 Jul 2015 10:50:31 -0300
From:	Arnaldo Carvalho de Melo <acme@...nel.org>
To:	Adrian Hunter <adrian.hunter@...el.com>
Cc:	Peter Zijlstra <peterz@...radead.org>,
	Andi Kleen <ak@...ux.intel.com>,
	Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org,
	Jiri Olsa <jolsa@...hat.com>,
	Stephane Eranian <eranian@...gle.com>,
	mathieu.poirier@...aro.org, Pawel Moll <pawel.moll@....com>
Subject: Re: [PATCH V3 2/4] perf tools: Add new PERF_RECORD_SWITCH event

Em Tue, Jul 07, 2015 at 11:36:40AM +0300, Adrian Hunter escreveu:
> +size_t perf_event__fprintf_switch(union perf_event *event, FILE *fp)
> +{
> +	bool out = event->header.misc & PERF_RECORD_MISC_SWITCH_OUT;
> +	const char *in_out = out ? "OUT" : "IN ";
> +
> +	if (event->context_switch.next_prev_pid == (u32)-1)

I.e. we would have the test:

	if (!(event->header.misc & PERF_RECORD_MISC_SWITCH_NEXT_PREV_PID))
		return fprintf(fp, " %s\n", in_out);

> +	return fprintf(fp, " %s  %s pid/tid: %5u/%-5u\n",
> +		       in_out, out ? "next" : "prev",
> +		       event->context_switch.next_prev_pid,
> +		       event->context_switch.next_prev_tid);


<SNIP>

> +static void perf_event__switch_swap(union perf_event *event, bool sample_id_all)
> +{

Here too:

	if (event->header.misc & PERF_RECORD_MISC_SWITCH_NEXT_PREV_PID) {
		event->context_switch.next_prev_pid = bswap_32(event->context_switch.next_prev_pid);
		event->context_switch.next_prev_tid = bswap_32(event->context_switch.next_prev_tid);
		if (sample_id_all)
			swap_sample_id_all(event, &event->context_switch + 1);
	} else if (sample_id_all)
		swap_sample_id_all(event, &event->header + 1);
> +}
> +
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ