Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1250461

Re: [PATCH 1/1] perf/x86: Fix time_shift in perf_event_mmap_page

From Adrian Hunter <adrian.hunter@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1] perf/x86: Fix time_shift in perf_event_mmap_page
Date 2015-10-19 10:50 +0200
Message-ID <qleiK-7D6-13@gated-at.bofh.it> (permalink)
References <qkdf5-7zE-31@gated-at.bofh.it> <qkdf5-7zE-45@gated-at.bofh.it> <qldG1-6ST-21@gated-at.bofh.it>
Organization Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki

Show all headers | View raw


On 19/10/15 11:08, Ingo Molnar wrote:
> 
> * Adrian Hunter <adrian.hunter@intel.com> wrote:
> 
>> Commit b20112edeadf ("perf/x86: Improve accuracy of perf/sched clock")
>> allowed the time_shift value in perf_event_mmap_page to be as much
>> as 32.  Unfortunately the documented algorithms for using time_shift
>> have it shifting an integer, whereas to work correctly with the value
>> 32, the type must be u64.
>>
>> Fix by limiting the shift to 31 and adjusting the multiplier accordingly.
>>
>> Also update the documentation of perf_event_mmap_page so that new code
>> based on it will be more future-proof.
>>
>> Fixes: b20112edeadf ("perf/x86: Improve accuracy of perf/sched clock")
>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> 
> Would be nice to point out via what symptoms the code misbehaves and how users 
> notice.

In the case of perf tools, Intel PT decodes correctly but the timestamps
that are output (for example by perf script) have lost 32-bits of
granularity so they look like they are not changing at all.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/1] perf/x86: Fix time_shift in perf_event_mmap_page Adrian Hunter <adrian.hunter@intel.com> - 2015-10-16 15:30 +0200
  [PATCH 1/1] perf/x86: Fix time_shift in perf_event_mmap_page Adrian Hunter <adrian.hunter@intel.com> - 2015-10-16 15:30 +0200
    Re: [PATCH 1/1] perf/x86: Fix time_shift in perf_event_mmap_page Ingo Molnar <mingo@kernel.org> - 2015-10-19 10:10 +0200
      Re: [PATCH 1/1] perf/x86: Fix time_shift in perf_event_mmap_page Adrian Hunter <adrian.hunter@intel.com> - 2015-10-19 10:50 +0200
        Re: [PATCH 1/1] perf/x86: Fix time_shift in perf_event_mmap_page Ingo Molnar <mingo@kernel.org> - 2015-10-19 13:30 +0200
          [PATCH V2 1/1] perf/x86: Fix time_shift in perf_event_mmap_page Adrian Hunter <adrian.hunter@intel.com> - 2015-10-19 14:10 +0200
    [tip:perf/core] perf/x86: Fix time_shift in perf_event_mmap_page tip-bot for Adrian Hunter <tipbot@zytor.com> - 2015-10-20 11:40 +0200

csiph-web