1. 11 7月, 2019 2 次提交
  2. 09 7月, 2019 3 次提交
  3. 11 6月, 2019 13 次提交
  4. 03 5月, 2019 2 次提交
  5. 15 2月, 2019 14 次提交
  6. 06 2月, 2019 5 次提交
    • L
      perf cs-etm: Set sample flags for exception return packet · 173e65f6
      Leo Yan 提交于
      When return from exception, we need to distinguish if it's system call
      return or for other type exceptions for setting sample flags.  Due to
      the exception return packet doesn't contain exception number, so we
      cannot decide sample flags based on exception number.
      
      On the other hand, the exception return packet is followed by an
      instruction range packet; this range packet deliveries the start address
      after exception handling, we can check if it is a SVC instruction just
      before the start address.  If there has one SVC instruction is found
      ahead the return address, this means it's an exception return for system
      call; otherwise it is an normal return for other exceptions.
      
      This patch is to set sample flags for exception return packet, firstly
      it simply set sample flags as PERF_IP_FLAG_INTERRUPT for all exception
      returns since at this point it doesn't know what's exactly the exception
      type.  We will defer to decide if it's an exception return for system
      call when the next instruction range packet comes, it checks if there
      has one SVC instruction prior to the start address and if so we will
      change sample flags to PERF_IP_FLAG_SYSCALLRET for system call return.
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Robert Walker <robert.walker@arm.com>
      Cc: Suzuki K Poulouse <suzuki.poulose@arm.com>
      Cc: coresight ml <coresight@lists.linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/20190129122842.32041-9-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      173e65f6
    • L
      perf cs-etm: Set sample flags for exception packet · 96dce7f4
      Leo Yan 提交于
      The exception taken and returning are typical flow for instruction jump
      but it needs to be handled with exception packets. This patch is to set
      sample flags for exception packet.
      
      Since the exception packet contains the exception number, according to
      the exception number this patch makes decision for belonging to which
      exception types.
      
      The decoder have defined different exception number for ETMv3 and ETMv4
      separately, hence this patch needs firstly decide the ETM version by
      using the metadata magic number, and this patch adds helper function
      cs_etm__get_magic() for easily getting magic number.
      
      Based on different ETM version, the exception packet contains the
      exception number, according to the exception number this patch makes
      decision for the exception belonging to which exception types.
      
      In this patch, it introduces helper function cs_etm__is_svc_instr(); for
      ETMv4 CS_ETMV4_EXC_CALL covers SVC, SMC and HVC cases in the single
      exception number, thus need to use cs_etm__is_svc_instr() to decide an
      exception taken for system call.
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Reviewed-by: NRobert Walker <robert.walker@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Suzuki K Poulouse <suzuki.poulose@arm.com>
      Cc: coresight ml <coresight@lists.linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/20190129122842.32041-8-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      96dce7f4
    • L
      perf cs-etm: Change tuple from traceID-CPU# to traceID-metadata · 95c6fe97
      Leo Yan 提交于
      If packet processing wants to know the packet is bound with which ETM
      version, it needs to access metadata to decide that based on metadata
      magic number; but we cannot simply to use CPU logic ID number as index
      to access metadata sequential array, especially when system have
      hotplugged off CPUs, the metadata array are only allocated for online
      CPUs but not offline CPUs, so the CPU logic number doesn't match with
      its index in the array.
      
      This patch is to change tuple from traceID-CPU# to traceID-metadata,
      thus it can use the tuple to retrieve metadata pointer according to
      traceID.
      
      For safe accessing metadata fields, this patch provides helper function
      cs_etm__get_cpu() which is used to return CPU number according to
      traceID; cs_etm_decoder__buffer_packet() is the first consumer for this
      helper function.
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Robert Walker <robert.walker@arm.com>
      Cc: Suzuki K Poulouse <suzuki.poulose@arm.com>
      Cc: coresight ml <coresight@lists.linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/20190129122842.32041-6-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      95c6fe97
    • L
      perf cs-etm: Set sample flags for trace discontinuity · 465eaaa8
      Leo Yan 提交于
      In the middle of trace stream, it might be interrupted thus the trace
      data is not continuous, the trace stream firstly is ended for previous
      trace block and restarted for next block.
      
      To display related information for showing trace is restarted, this
      patch set sample flags for trace discontinuity:
      
      - If one discontinuity packet is coming, append flag
        PERF_IP_FLAG_TRACE_END to the previous packet to indicate the trace
        has been ended;
      - If one instruction packet is following discontinuity packet, this
        instruction packet is the first one packet to restarting trace.  So
        set flag PERF_IP_FLAG_TRACE_START to discontinuity packet, this flag
        will be used to generate sample when connect with the sequential
        instruction packet.
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Robert Walker <robert.walker@arm.com>
      Cc: Suzuki K Poulouse <suzuki.poulose@arm.com>
      Cc: coresight ml <coresight@lists.linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/20190129122842.32041-4-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      465eaaa8
    • L
      perf cs-etm: Set sample flags for instruction range packet · 06220bf4
      Leo Yan 提交于
      The perf sample data contains flags to indicate the hardware trace data
      is belonging to which type branch instruction, thus this can be used to
      print out the human readable string.  Arm CoreSight ETM sample data is
      missed to set flags and it is always set to zeros, this results in perf
      tool skips to print string for instruction types.
      
      This patch is to set branch instruction flags for instruction range
      packet.
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Robert Walker <robert.walker@arm.com>
      Cc: Suzuki K Poulouse <suzuki.poulose@arm.com>
      Cc: coresight ml <coresight@lists.linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/20190129122842.32041-3-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      06220bf4
  7. 18 12月, 2018 1 次提交
    • L
      perf cs-etm: Generate branch sample for exception packet · 7100b12c
      Leo Yan 提交于
      The exception packet appears as one element with 'elem_type' ==
      OCSD_GEN_TRC_ELEM_EXCEPTION or OCSD_GEN_TRC_ELEM_EXCEPTION_RET, which is
      present for exception entry and exit respectively.  The decoder sets the
      packet fields 'packet->exc' and 'packet->exc_ret' to indicate the
      exception packets; but exception packets don't have a dedicated sample
      type and shares the same sample type CS_ETM_RANGE with normal
      instruction packets.
      
      As a result, the exception packets are taken as normal instruction
      packets and this introduces confusion in mixing different packet types.
      Furthermore, these instruction range packets will be processed for
      branch samples only when 'packet->last_instr_taken_branch' is true,
      otherwise they will be omitted, this can introduce a mess for exception
      and exception returning due to not having the complete address range
      info for context switching.
      
      To process exception packets properly, this patch introduces two new
      sample types: CS_ETM_EXCEPTION and CS_ETM_EXCEPTION_RET; these two types
      of packets will be handled by cs_etm__exception().  The function
      cs_etm__exception() forces setting the previous CS_ETM_RANGE packet flag
      'prev_packet->last_instr_taken_branch' to true, this matches well with
      the program flow when the exception is trapped from user space to kernel
      space, no matter if the most recent flow has branch taken or not; this
      is also safe for returning to user space after exception handling.
      
      After exception packets have their own sample type, the packet fields
      'packet->exc' and 'packet->exc_ret' aren't needed anymore, so remove
      them.
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Robert Walker <robert.walker@arm.com>
      Cc: coresight ml <coresight@lists.linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/1544513908-16805-9-git-send-email-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7100b12c