lkml.org 
[lkml]   [2015]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[tip:perf/core] perf tools: Allow auxtrace data alignment
    Commit-ID:  83b2ea257eb1d43e52f76d756722aeb899a2852c
    Gitweb: http://git.kernel.org/tip/83b2ea257eb1d43e52f76d756722aeb899a2852c
    Author: Adrian Hunter <adrian.hunter@intel.com>
    AuthorDate: Fri, 29 May 2015 16:33:38 +0300
    Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
    CommitDate: Tue, 23 Jun 2015 18:28:37 -0300

    perf tools: Allow auxtrace data alignment

    Allow auxtrace data to be a multiple of something other than page size.
    That is needed for BTS where the buffer contains 24-byte records.

    Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Link: http://lkml.kernel.org/r/1432906425-9911-11-git-send-email-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    ---
    tools/perf/util/auxtrace.c | 7 +++++++
    tools/perf/util/auxtrace.h | 1 +
    2 files changed, 8 insertions(+)

    diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
    index 3dab006..7e7405c 100644
    --- a/tools/perf/util/auxtrace.c
    +++ b/tools/perf/util/auxtrace.c
    @@ -1182,6 +1182,13 @@ static int __auxtrace_mmap__read(struct auxtrace_mmap *mm,
    data2 = NULL;
    }

    + if (itr->alignment) {
    + unsigned int unwanted = len1 % itr->alignment;
    +
    + len1 -= unwanted;
    + size -= unwanted;
    + }
    +
    /* padding must be written by fn() e.g. record__process_auxtrace() */
    padding = size & 7;
    if (padding)
    diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h
    index a171abb..471aecb 100644
    --- a/tools/perf/util/auxtrace.h
    +++ b/tools/perf/util/auxtrace.h
    @@ -303,6 +303,7 @@ struct auxtrace_record {
    const char *str);
    u64 (*reference)(struct auxtrace_record *itr);
    int (*read_finish)(struct auxtrace_record *itr, int idx);
    + unsigned int alignment;
    };

    #ifdef HAVE_AUXTRACE_SUPPORT

    \
     
     \ /
      Last update: 2015-06-25 10:01    [W:6.285 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site