summaryrefslogtreecommitdiff
path: root/tools/perf
diff options
context:
space:
mode:
authorBlagovest Kolenichev <bkolenichev@codeaurora.org>2018-07-03 12:24:13 -0700
committerBlagovest Kolenichev <bkolenichev@codeaurora.org>2018-07-03 12:24:56 -0700
commite1496b74425e222e349b829e84415a380a59f178 (patch)
tree383c69f3ffb0a8f090a3e77d38b37a7b652e7fda /tools/perf
parentd8c2c85fcdf401331649be84777a5f9e42cd2b9f (diff)
parent7ba55570970cdd9f14e81a98af451d6efc0e2cbc (diff)
Merge android-4.4.139 (7ba5557) into msm-4.4
* refs/heads/tmp-7ba5557 Linux 4.4.139 Bluetooth: Fix connection if directed advertising and privacy is used cdc_ncm: avoid padding beyond end of skb dm thin: handle running out of data space vs concurrent discard block: Fix transfer when chunk sectors exceeds max spi: Fix scatterlist elements size in spi_map_buf Btrfs: fix unexpected cow in run_delalloc_nocow ALSA: hda/realtek - Add a quirk for FSC ESPRIMO U9210 Input: elantech - fix V4 report decoding for module with middle key Input: elantech - enable middle button of touchpads on ThinkPad P52 Input: elan_i2c_smbus - fix more potential stack buffer overflows udf: Detect incorrect directory size xen: Remove unnecessary BUG_ON from __unbind_from_irq() Input: elan_i2c - add ELAN0618 (Lenovo v330 15IKB) ACPI ID video: uvesafb: Fix integer overflow in allocation NFSv4: Fix possible 1-byte stack overflow in nfs_idmap_read_and_verify_message nfsd: restrict rd_maxcount to svc_max_payload in nfsd_encode_readdir media: dvb_frontend: fix locking issues at dvb_frontend_get_event() media: cx231xx: Add support for AverMedia DVD EZMaker 7 media: v4l2-compat-ioctl32: prevent go past max size perf intel-pt: Fix packet decoding of CYC packets perf intel-pt: Fix "Unexpected indirect branch" error perf intel-pt: Fix MTC timing after overflow perf intel-pt: Fix decoding to accept CBR between FUP and corresponding TIP perf intel-pt: Fix sync_switch INTEL_PT_SS_NOT_TRACING perf tools: Fix symbol and object code resolution for vdso32 and vdsox32 mfd: intel-lpss: Program REMAP register in PIO mode backlight: tps65217_bl: Fix Device Tree node lookup backlight: max8925_bl: Fix Device Tree node lookup backlight: as3711_bl: Fix Device Tree node lookup xfrm: skip policies marked as dead while rehashing xfrm: Ignore socket policies when rebuilding hash tables UBIFS: Fix potential integer overflow in allocation ubi: fastmap: Cancel work upon detach md: fix two problems with setting the "re-add" device state. linvdimm, pmem: Preserve read-only setting for pmem devices scsi: zfcp: fix missing REC trigger trace on enqueue without ERP thread scsi: zfcp: fix missing REC trigger trace for all objects in ERP_FAILED scsi: zfcp: fix missing REC trigger trace on terminate_rport_io for ERP_FAILED scsi: zfcp: fix missing REC trigger trace on terminate_rport_io early return scsi: zfcp: fix misleading REC trigger trace where erp_action setup failed scsi: zfcp: fix missing SCSI trace for retry of abort / scsi_eh TMF scsi: zfcp: fix missing SCSI trace for result of eh_host_reset_handler scsi: qla2xxx: Fix setting lower transfer speed if GPSC fails iio:buffer: make length types match kfifo types Btrfs: fix clone vs chattr NODATASUM race time: Make sure jiffies_to_msecs() preserves non-zero time periods MIPS: io: Add barrier after register read in inX() PCI: pciehp: Clear Presence Detect and Data Link Layer Status Changed on resume MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum mtd: cfi_cmdset_0002: Avoid walking all chips when unlocking. mtd: cfi_cmdset_0002: Fix unlocking requests crossing a chip boudary mtd: cfi_cmdset_0002: fix SEGV unlocking multiple chips mtd: cfi_cmdset_0002: Use right chip in do_ppb_xxlock() mtd: cfi_cmdset_0002: Change write buffer to check correct value RDMA/mlx4: Discard unknown SQP work requests IB/qib: Fix DMA api warning with debug kernel of: unittest: for strings, account for trailing \0 in property length field ARM: 8764/1: kgdb: fix NUMREGBYTES so that gdb_regs[] is the correct size powerpc/fadump: Unregister fadump on kexec down path. cpuidle: powernv: Fix promotion from snooze if next state disabled powerpc/ptrace: Fix enforcement of DAWR constraints powerpc/ptrace: Fix setting 512B aligned breakpoints with PTRACE_SET_DEBUGREG powerpc/mm/hash: Add missing isync prior to kernel stack SLB switch fuse: fix control dir setup and teardown fuse: don't keep dead fuse_conn at fuse_fill_super(). fuse: atomic_o_trunc should truncate pagecache Bluetooth: hci_qca: Avoid missing rampatch failure with userspace fw loader ipmi:bt: Set the timeout before doing a capabilities check branch-check: fix long->int truncation when profiling branches mips: ftrace: fix static function graph tracing lib/vsprintf: Remove atomic-unsafe support for %pCr ASoC: cirrus: i2s: Fix {TX|RX}LinCtrlData setup ASoC: cirrus: i2s: Fix LRCLK configuration ASoC: dapm: delete dapm_kcontrol_data paths list before freeing it 1wire: family module autoload fails because of upper/lower case mismatch. usb: do not reset if a low-speed or full-speed device timed out signal/xtensa: Consistenly use SIGBUS in do_unaligned_user serial: sh-sci: Use spin_{try}lock_irqsave instead of open coding version m68k/mm: Adjust VM area to be unmapped by gap size for __iounmap() x86/spectre_v1: Disable compiler optimizations over array_index_mask_nospec() fs/binfmt_misc.c: do not allow offset overflow w1: mxc_w1: Enable clock before calling clk_get_rate() on it libata: Drop SanDisk SD7UB3Q*G1001 NOLPM quirk libata: zpodd: small read overflow in eject_tray() libata: zpodd: make arrays cdb static, reduces object code size cpufreq: Fix new policy initialization during limits updates via sysfs ALSA: hda: add dock and led support for HP ProBook 640 G4 ALSA: hda: add dock and led support for HP EliteBook 830 G5 ALSA: hda - Handle kzalloc() failure in snd_hda_attach_pcm_stream() btrfs: scrub: Don't use inode pages for device replace driver core: Don't ignore class_dir_create_and_add() failure. ext4: fix fencepost error in check for inode count overflow during resize ext4: update mtime in ext4_punch_hole even if no blocks are released tcp: verify the checksum of the first data segment in a new connection bonding: re-evaluate force_primary when the primary slave name changes usb: musb: fix remote wakeup racing with suspend Btrfs: make raid6 rebuild retry more tcp: do not overshoot window_clamp in tcp_rcv_space_adjust() Revert "Btrfs: fix scrub to repair raid6 corruption" net/sonic: Use dma_mapping_error() net: qmi_wwan: Add Netgear Aircard 779S atm: zatm: fix memcmp casting ipvs: fix buffer overflow with sync daemon and service netfilter: ebtables: handle string from userspace with care xfrm6: avoid potential infinite loop in _decode_session6() ANDROID: Add kconfig to make dm-verity check_at_most_once default enabled ANDROID: sdcardfs: fix potential crash when reserved_mb is not zero Change-Id: Ibcd2b6614843e4e8fd5a57acf350a9e83e1c0dbc Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/dso.c2
-rw-r--r--tools/perf/util/intel-pt-decoder/intel-pt-decoder.c23
-rw-r--r--tools/perf/util/intel-pt-decoder/intel-pt-decoder.h9
-rw-r--r--tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c2
-rw-r--r--tools/perf/util/intel-pt.c5
5 files changed, 36 insertions, 5 deletions
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 425df5c86c9c..425597186677 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -249,6 +249,8 @@ int __kmod_path__parse(struct kmod_path *m, const char *path,
if ((strncmp(name, "[kernel.kallsyms]", 17) == 0) ||
(strncmp(name, "[guest.kernel.kallsyms", 22) == 0) ||
(strncmp(name, "[vdso]", 6) == 0) ||
+ (strncmp(name, "[vdso32]", 8) == 0) ||
+ (strncmp(name, "[vdsox32]", 9) == 0) ||
(strncmp(name, "[vsyscall]", 10) == 0)) {
m->kmod = false;
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
index 0b540b84f8b7..dc17c881275d 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
@@ -111,6 +111,7 @@ struct intel_pt_decoder {
bool have_cyc;
bool fixup_last_mtc;
bool have_last_ip;
+ enum intel_pt_param_flags flags;
uint64_t pos;
uint64_t last_ip;
uint64_t ip;
@@ -213,6 +214,8 @@ struct intel_pt_decoder *intel_pt_decoder_new(struct intel_pt_params *params)
decoder->data = params->data;
decoder->return_compression = params->return_compression;
+ decoder->flags = params->flags;
+
decoder->period = params->period;
decoder->period_type = params->period_type;
@@ -1010,6 +1013,15 @@ out_no_progress:
return err;
}
+static inline bool intel_pt_fup_with_nlip(struct intel_pt_decoder *decoder,
+ struct intel_pt_insn *intel_pt_insn,
+ uint64_t ip, int err)
+{
+ return decoder->flags & INTEL_PT_FUP_WITH_NLIP && !err &&
+ intel_pt_insn->branch == INTEL_PT_BR_INDIRECT &&
+ ip == decoder->ip + intel_pt_insn->length;
+}
+
static int intel_pt_walk_fup(struct intel_pt_decoder *decoder)
{
struct intel_pt_insn intel_pt_insn;
@@ -1022,7 +1034,8 @@ static int intel_pt_walk_fup(struct intel_pt_decoder *decoder)
err = intel_pt_walk_insn(decoder, &intel_pt_insn, ip);
if (err == INTEL_PT_RETURN)
return 0;
- if (err == -EAGAIN) {
+ if (err == -EAGAIN ||
+ intel_pt_fup_with_nlip(decoder, &intel_pt_insn, ip, err)) {
if (decoder->set_fup_tx_flags) {
decoder->set_fup_tx_flags = false;
decoder->tx_flags = decoder->fup_tx_flags;
@@ -1032,7 +1045,7 @@ static int intel_pt_walk_fup(struct intel_pt_decoder *decoder)
decoder->state.flags = decoder->fup_tx_flags;
return 0;
}
- return err;
+ return -EAGAIN;
}
decoder->set_fup_tx_flags = false;
if (err)
@@ -1268,7 +1281,6 @@ static int intel_pt_overflow(struct intel_pt_decoder *decoder)
{
intel_pt_log("ERROR: Buffer overflow\n");
intel_pt_clear_tx_flags(decoder);
- decoder->have_tma = false;
decoder->cbr = 0;
decoder->timestamp_insn_cnt = 0;
decoder->pkt_state = INTEL_PT_STATE_ERR_RESYNC;
@@ -1487,7 +1499,6 @@ static int intel_pt_walk_fup_tip(struct intel_pt_decoder *decoder)
case INTEL_PT_PSB:
case INTEL_PT_TSC:
case INTEL_PT_TMA:
- case INTEL_PT_CBR:
case INTEL_PT_MODE_TSX:
case INTEL_PT_BAD:
case INTEL_PT_PSBEND:
@@ -1496,6 +1507,10 @@ static int intel_pt_walk_fup_tip(struct intel_pt_decoder *decoder)
decoder->pkt_step = 0;
return -ENOENT;
+ case INTEL_PT_CBR:
+ intel_pt_calc_cbr(decoder);
+ break;
+
case INTEL_PT_OVF:
return intel_pt_overflow(decoder);
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.h b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.h
index 89a3eda6a318..e420bd3be159 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.h
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.h
@@ -53,6 +53,14 @@ enum {
INTEL_PT_ERR_MAX,
};
+enum intel_pt_param_flags {
+ /*
+ * FUP packet can contain next linear instruction pointer instead of
+ * current linear instruction pointer.
+ */
+ INTEL_PT_FUP_WITH_NLIP = 1 << 0,
+};
+
struct intel_pt_state {
enum intel_pt_sample_type type;
int err;
@@ -91,6 +99,7 @@ struct intel_pt_params {
unsigned int mtc_period;
uint32_t tsc_ctc_ratio_n;
uint32_t tsc_ctc_ratio_d;
+ enum intel_pt_param_flags flags;
};
struct intel_pt_decoder;
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
index 7528ae4f7e28..e5c6caf913f3 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
@@ -281,7 +281,7 @@ static int intel_pt_get_cyc(unsigned int byte, const unsigned char *buf,
if (len < offs)
return INTEL_PT_NEED_MORE_BYTES;
byte = buf[offs++];
- payload |= (byte >> 1) << shift;
+ payload |= ((uint64_t)byte >> 1) << shift;
}
packet->type = INTEL_PT_CYC;
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index 3693cb26ec66..c8f2d084a8ce 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -676,6 +676,7 @@ static struct intel_pt_queue *intel_pt_alloc_queue(struct intel_pt *pt,
unsigned int queue_nr)
{
struct intel_pt_params params = { .get_trace = 0, };
+ struct perf_env *env = pt->machine->env;
struct intel_pt_queue *ptq;
ptq = zalloc(sizeof(struct intel_pt_queue));
@@ -753,6 +754,9 @@ static struct intel_pt_queue *intel_pt_alloc_queue(struct intel_pt *pt,
}
}
+ if (env->cpuid && !strncmp(env->cpuid, "GenuineIntel,6,92,", 18))
+ params.flags |= INTEL_PT_FUP_WITH_NLIP;
+
ptq->decoder = intel_pt_decoder_new(&params);
if (!ptq->decoder)
goto out_free;
@@ -1246,6 +1250,7 @@ static int intel_pt_sample(struct intel_pt_queue *ptq)
if (intel_pt_is_switch_ip(ptq, state->to_ip)) {
switch (ptq->switch_state) {
+ case INTEL_PT_SS_NOT_TRACING:
case INTEL_PT_SS_UNKNOWN:
case INTEL_PT_SS_EXPECTING_SWITCH_IP:
err = intel_pt_next_tid(pt, ptq);