• John Garry's avatar
    perf vendor events: Add support for arch standard events · e9d32c1b
    John Garry authored
    For some architectures (like arm), there are architecture- defined
    events. Sometimes these events may be "recommended" according to the
    architecture standard, in that the implementer is free ignore the
    "recommendation" and create its custom event.
    
    This patch adds support for parsing standard events from arch-defined
    JSONs, and fixing up vendor events when they have implemented these
    events as standard.
    
    Support is also ensured that the vendor may implement their own custom
    events.
    
    A new step is added to the pmu events parsing to fix up the vendor
    events with the arch-standard events.
    
    The arch-defined JSONs must be placed in the arch root folder for
    preprocessing prior to tree JSON processing.
    
    In the vendor JSON, to specify that the arch event is supported, the
    keyword "ArchStdEvent" should be used, like this:
    
    [
        {
            "ArchStdEvent": "L1D_CACHE_WR",
        },
    ]
    
    Matching is based on the "EventName" field in the architecture JSON.
    
    No other JSON objects are strictly required. However, for other objects
    added, these take precedence over architecture defined standard events,
    thus supporting separate events which have the same event code.
    Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
    Cc: Will Deacon <will.deacon@arm.com>
    Cc: William Cohen <wcohen@redhat.com>
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linuxarm@huawei.com
    Link: http://lkml.kernel.org/r/1520506716-197429-8-git-send-email-john.garry@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    e9d32c1b