lkml.org 
[lkml]   [2012]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 02/16] perf: Add ability to attach registers dump to sample
From
Date
On Wed, 2012-05-23 at 21:32 +0200, Jiri Olsa wrote:
> +perf_output_sample_regs(struct perf_output_handle *handle,
> + struct pt_regs *regs, u64 mask)
> +{
> + int i = 0;
> +
> + do {
> + u64 val;
> +
> + if (mask & 1) {
> + val = perf_reg_value(regs, i);
> + perf_output_put(handle, val);
> + }
> +
> + mask >>= 1;
> + i++;
> + } while (mask);
> +}

we have bitmap functions available that can do this far faster on a
number of architectures (like x86) that have bit scanning instructions.



\
 
 \ /
  Last update: 2012-05-24 12:41    [W:0.173 / U:0.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site