diff options
Diffstat (limited to 'include/trace')
28 files changed, 4971 insertions, 16 deletions
diff --git a/include/trace/events/almk.h b/include/trace/events/almk.h new file mode 100644 index 000000000000..85d712d48f50 --- /dev/null +++ b/include/trace/events/almk.h @@ -0,0 +1,84 @@ +/* Copyright (c) 2015, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM almk + +#if !defined(_TRACE_EVENT_ALMK_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_EVENT_ALMK_H + +#include <linux/tracepoint.h> +#include <linux/types.h> + +TRACE_EVENT(almk_vmpressure, + + TP_PROTO(unsigned long pressure, + int other_free, + int other_file), + + TP_ARGS(pressure, other_free, other_file), + + TP_STRUCT__entry( + __field(unsigned long, pressure) + __field(int, other_free) + __field(int, other_file) + ), + + TP_fast_assign( + __entry->pressure = pressure; + __entry->other_free = other_free; + __entry->other_file = other_file; + ), + + TP_printk("%lu, %d, %d", + __entry->pressure, __entry->other_free, + __entry->other_file) +); + +TRACE_EVENT(almk_shrink, + + TP_PROTO(int tsize, + int vmp, + int other_free, + int other_file, + short adj), + + TP_ARGS(tsize, vmp, other_free, other_file, adj), + + TP_STRUCT__entry( + __field(int, tsize) + __field(int, vmp) + __field(int, other_free) + __field(int, other_file) + __field(short, adj) + ), + + TP_fast_assign( + __entry->tsize = tsize; + __entry->vmp = vmp; + __entry->other_free = other_free; + __entry->other_file = other_file; + __entry->adj = adj; + ), + + TP_printk("%d, %d, %d, %d, %d", + __entry->tsize, + __entry->vmp, + __entry->other_free, + __entry->other_file, + __entry->adj) +); + +#endif + +#include <trace/define_trace.h> + diff --git a/include/trace/events/clk.h b/include/trace/events/clk.h index 2cd449328aee..cd9c6dbddffd 100644 --- a/include/trace/events/clk.h +++ b/include/trace/events/clk.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2015, 2017, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -192,6 +192,42 @@ DEFINE_EVENT(clk_phase, clk_set_phase_complete, TP_ARGS(core, phase) ); +DECLARE_EVENT_CLASS(clk_state_dump, + + TP_PROTO(const char *name, unsigned int prepare_count, + unsigned int enable_count, unsigned long rate, unsigned int vdd_level), + + TP_ARGS(name, prepare_count, enable_count, rate, vdd_level), + + TP_STRUCT__entry( + __string(name, name) + __field(unsigned int, prepare_count) + __field(unsigned int, enable_count) + __field(unsigned long, rate) + __field(unsigned int, vdd_level) + ), + + TP_fast_assign( + __assign_str(name, name); + __entry->prepare_count = prepare_count; + __entry->enable_count = enable_count; + __entry->rate = rate; + __entry->vdd_level = vdd_level; + ), + + TP_printk("%s\tprepare:enable cnt [%u:%u]\trate: vdd_level [%lu:%u]", + __get_str(name), __entry->prepare_count, __entry->enable_count, + __entry->rate, __entry->vdd_level) +); + +DEFINE_EVENT(clk_state_dump, clk_state, + + TP_PROTO(const char *name, unsigned int prepare_count, + unsigned int enable_count, unsigned long rate, unsigned int vdd_level), + + TP_ARGS(name, prepare_count, enable_count, rate, vdd_level) +); + #endif /* _TRACE_CLK_H */ /* This part must be outside protection */ diff --git a/include/trace/events/cma.h b/include/trace/events/cma.h index d7cd961720a7..693fceb8a484 100644 --- a/include/trace/events/cma.h +++ b/include/trace/events/cma.h @@ -7,7 +7,7 @@ #include <linux/types.h> #include <linux/tracepoint.h> -TRACE_EVENT(cma_alloc, +DECLARE_EVENT_CLASS(cma_alloc_class, TP_PROTO(unsigned long pfn, const struct page *page, unsigned int count, unsigned int align), @@ -60,6 +60,44 @@ TRACE_EVENT(cma_release, __entry->count) ); +TRACE_EVENT(cma_alloc_start, + + TP_PROTO(unsigned int count, unsigned int align), + + TP_ARGS(count, align), + + TP_STRUCT__entry( + __field(unsigned int, count) + __field(unsigned int, align) + ), + + TP_fast_assign( + __entry->count = count; + __entry->align = align; + ), + + TP_printk("count=%u align=%u", + __entry->count, + __entry->align) +); + +DEFINE_EVENT(cma_alloc_class, cma_alloc, + + TP_PROTO(unsigned long pfn, const struct page *page, + unsigned int count, unsigned int align), + + TP_ARGS(pfn, page, count, align) +); + +DEFINE_EVENT(cma_alloc_class, cma_alloc_busy_retry, + + TP_PROTO(unsigned long pfn, const struct page *page, + unsigned int count, unsigned int align), + + TP_ARGS(pfn, page, count, align) +); + + #endif /* _TRACE_CMA_H */ /* This part must be outside protection */ diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h index c92d1e1cbad9..223450aeb49e 100644 --- a/include/trace/events/compaction.h +++ b/include/trace/events/compaction.h @@ -350,6 +350,61 @@ DEFINE_EVENT(mm_compaction_defer_template, mm_compaction_defer_reset, ); #endif +TRACE_EVENT(mm_compaction_kcompactd_sleep, + + TP_PROTO(int nid), + + TP_ARGS(nid), + + TP_STRUCT__entry( + __field(int, nid) + ), + + TP_fast_assign( + __entry->nid = nid; + ), + + TP_printk("nid=%d", __entry->nid) +); + +DECLARE_EVENT_CLASS(kcompactd_wake_template, + + TP_PROTO(int nid, int order, enum zone_type classzone_idx), + + TP_ARGS(nid, order, classzone_idx), + + TP_STRUCT__entry( + __field(int, nid) + __field(int, order) + __field(enum zone_type, classzone_idx) + ), + + TP_fast_assign( + __entry->nid = nid; + __entry->order = order; + __entry->classzone_idx = classzone_idx; + ), + + TP_printk("nid=%d order=%d classzone_idx=%-8s", + __entry->nid, + __entry->order, + __print_symbolic(__entry->classzone_idx, ZONE_TYPE)) +); + +DEFINE_EVENT(kcompactd_wake_template, mm_compaction_wakeup_kcompactd, + + TP_PROTO(int nid, int order, enum zone_type classzone_idx), + + TP_ARGS(nid, order, classzone_idx) +); + +DEFINE_EVENT(kcompactd_wake_template, mm_compaction_kcompactd_wake, + + TP_PROTO(int nid, int order, enum zone_type classzone_idx), + + TP_ARGS(nid, order, classzone_idx) +); + #endif /* _TRACE_COMPACTION_H */ /* This part must be outside protection */ diff --git a/include/trace/events/cpufreq_interactive.h b/include/trace/events/cpufreq_interactive.h index 951e6ca12da8..61992e64fd18 100644 --- a/include/trace/events/cpufreq_interactive.h +++ b/include/trace/events/cpufreq_interactive.h @@ -106,6 +106,42 @@ TRACE_EVENT(cpufreq_interactive_unboost, TP_printk("%s", __get_str(s)) ); +TRACE_EVENT(cpufreq_interactive_load_change, + TP_PROTO(unsigned long cpu_id), + TP_ARGS(cpu_id), + TP_STRUCT__entry( + __field(unsigned long, cpu_id) + ), + TP_fast_assign( + __entry->cpu_id = cpu_id; + ), + TP_printk("re-evaluate for cpu=%lu", __entry->cpu_id) +); + +TRACE_EVENT(cpufreq_interactive_cpuload, + TP_PROTO(unsigned long cpu_id, unsigned int load, + unsigned int new_task_pct, unsigned int prev, + unsigned int predicted), + TP_ARGS(cpu_id, load, new_task_pct, prev, predicted), + TP_STRUCT__entry( + __field(unsigned long, cpu_id) + __field(unsigned int, load) + __field(unsigned int, new_task_pct) + __field(unsigned int, prev) + __field(unsigned int, predicted) + ), + TP_fast_assign( + __entry->cpu_id = cpu_id; + __entry->load = load; + __entry->new_task_pct = new_task_pct; + __entry->prev = prev; + __entry->predicted = predicted; + ), + TP_printk("cpu=%lu load=%u new_task_pct=%u prev=%u predicted=%u", + __entry->cpu_id, __entry->load, __entry->new_task_pct, + __entry->prev, __entry->predicted) +); + #endif /* _TRACE_CPUFREQ_INTERACTIVE_H */ /* This part must be outside protection */ diff --git a/include/trace/events/exception.h b/include/trace/events/exception.h new file mode 100644 index 000000000000..6b525da1432e --- /dev/null +++ b/include/trace/events/exception.h @@ -0,0 +1,124 @@ +/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM exception + +#if !defined(_TRACE_EXCEPTION_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_EXCEPTION_H + +#include <linux/tracepoint.h> + +struct task_struct; + +TRACE_EVENT(user_fault, + + TP_PROTO(struct task_struct *tsk, unsigned long addr, unsigned int fsr), + + TP_ARGS(tsk, addr, fsr), + + TP_STRUCT__entry( + __string(task_name, tsk->comm) + __field(unsigned long, addr) + __field(unsigned int, fsr) + ), + + TP_fast_assign( + __assign_str(task_name, tsk->comm) + __entry->addr = addr; + __entry->fsr = fsr; + ), + + TP_printk("task_name:%s addr:%lu, fsr:%u", __get_str(task_name), + __entry->addr, __entry->fsr) +); + + +struct pt_regs; + +TRACE_EVENT(undef_instr, + + TP_PROTO(struct pt_regs *regs, void *prog_cnt), + + TP_ARGS(regs, prog_cnt), + + TP_STRUCT__entry( + __field(void *, prog_cnt) + __field(struct pt_regs *, regs) + ), + + TP_fast_assign( + __entry->regs = regs; + __entry->prog_cnt = prog_cnt; + ), + + TP_printk("pc:%p", __entry->prog_cnt) +); + +TRACE_EVENT(unhandled_abort, + + TP_PROTO(struct pt_regs *regs, unsigned long addr, unsigned int fsr), + + TP_ARGS(regs, addr, fsr), + + TP_STRUCT__entry( + __field(struct pt_regs *, regs) + __field(unsigned long, addr) + __field(unsigned int, fsr) + ), + + TP_fast_assign( + __entry->regs = regs; + __entry->addr = addr; + __entry->fsr = fsr; + ), + + TP_printk("addr:%lu, fsr:%u", __entry->addr, __entry->fsr) +); + +TRACE_EVENT(kernel_panic, + + TP_PROTO(long dummy), + + TP_ARGS(dummy), + + TP_STRUCT__entry( + __field(long, dummy) + ), + + TP_fast_assign( + __entry->dummy = dummy; + ), + + TP_printk("dummy:%ld", __entry->dummy) +); + +TRACE_EVENT(kernel_panic_late, + + TP_PROTO(long dummy), + + TP_ARGS(dummy), + + TP_STRUCT__entry( + __field(long, dummy) + ), + + TP_fast_assign( + __entry->dummy = dummy; + ), + + TP_printk("dummy:%ld", __entry->dummy) +); + +#endif + +#include <trace/define_trace.h> diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index 0cdf6cc5c557..b6850fe5465f 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h @@ -141,6 +141,17 @@ TRACE_DEFINE_ENUM(CP_TRIMMED); { CP_SPEC_LOG_NUM, "log type is 2" }, \ { CP_RECOVER_DIR, "dir needs recovery" }) +#define show_shutdown_mode(type) \ + __print_symbolic(type, \ + { F2FS_GOING_DOWN_FULLSYNC, "full sync" }, \ + { F2FS_GOING_DOWN_METASYNC, "meta sync" }, \ + { F2FS_GOING_DOWN_NOSYNC, "no sync" }, \ + { F2FS_GOING_DOWN_METAFLUSH, "meta flush" }, \ + { F2FS_GOING_DOWN_NEED_FSCK, "need fsck" }) + +struct f2fs_sb_info; +struct f2fs_io_info; +struct extent_info; struct victim_sel_policy; struct f2fs_map_blocks; @@ -514,6 +525,37 @@ TRACE_EVENT(f2fs_truncate_partial_nodes, __entry->err) ); +TRACE_EVENT(f2fs_file_write_iter, + + TP_PROTO(struct inode *inode, unsigned long offset, + unsigned long length, int ret), + + TP_ARGS(inode, offset, length, ret), + + TP_STRUCT__entry( + __field(dev_t, dev) + __field(ino_t, ino) + __field(unsigned long, offset) + __field(unsigned long, length) + __field(int, ret) + ), + + TP_fast_assign( + __entry->dev = inode->i_sb->s_dev; + __entry->ino = inode->i_ino; + __entry->offset = offset; + __entry->length = length; + __entry->ret = ret; + ), + + TP_printk("dev = (%d,%d), ino = %lu, " + "offset = %lu, length = %lu, written(err) = %d", + show_dev_ino(__entry), + __entry->offset, + __entry->length, + __entry->ret) +); + TRACE_EVENT(f2fs_map_blocks, TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret), @@ -525,6 +567,9 @@ TRACE_EVENT(f2fs_map_blocks, __field(block_t, m_lblk) __field(block_t, m_pblk) __field(unsigned int, m_len) + __field(unsigned int, m_flags) + __field(int, m_seg_type) + __field(bool, m_may_create) __field(int, ret) ), @@ -534,15 +579,22 @@ TRACE_EVENT(f2fs_map_blocks, __entry->m_lblk = map->m_lblk; __entry->m_pblk = map->m_pblk; __entry->m_len = map->m_len; + __entry->m_flags = map->m_flags; + __entry->m_seg_type = map->m_seg_type; + __entry->m_may_create = map->m_may_create; __entry->ret = ret; ), TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, " - "start blkaddr = 0x%llx, len = 0x%llx, err = %d", + "start blkaddr = 0x%llx, len = 0x%llx, flags = %u," + "seg_type = %d, may_create = %d, err = %d", show_dev_ino(__entry), (unsigned long long)__entry->m_lblk, (unsigned long long)__entry->m_pblk, (unsigned long long)__entry->m_len, + __entry->m_flags, + __entry->m_seg_type, + __entry->m_may_create, __entry->ret) ); @@ -964,8 +1016,8 @@ DECLARE_EVENT_CLASS(f2fs__submit_page_bio, ), TP_fast_assign( - __entry->dev = page->mapping->host->i_sb->s_dev; - __entry->ino = page->mapping->host->i_ino; + __entry->dev = page_file_mapping(page)->host->i_sb->s_dev; + __entry->ino = page_file_mapping(page)->host->i_ino; __entry->index = page->index; __entry->old_blkaddr = fio->old_blkaddr; __entry->new_blkaddr = fio->new_blkaddr; @@ -1152,10 +1204,11 @@ DECLARE_EVENT_CLASS(f2fs__page, ), TP_fast_assign( - __entry->dev = page->mapping->host->i_sb->s_dev; - __entry->ino = page->mapping->host->i_ino; + __entry->dev = page_file_mapping(page)->host->i_sb->s_dev; + __entry->ino = page_file_mapping(page)->host->i_ino; __entry->type = type; - __entry->dir = S_ISDIR(page->mapping->host->i_mode); + __entry->dir = + S_ISDIR(page_file_mapping(page)->host->i_mode); __entry->index = page->index; __entry->dirty = PageDirty(page); __entry->uptodate = PageUptodate(page); @@ -1220,6 +1273,32 @@ DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page, TP_ARGS(page, type) ); +TRACE_EVENT(f2fs_filemap_fault, + + TP_PROTO(struct inode *inode, pgoff_t index, unsigned long ret), + + TP_ARGS(inode, index, ret), + + TP_STRUCT__entry( + __field(dev_t, dev) + __field(ino_t, ino) + __field(pgoff_t, index) + __field(unsigned long, ret) + ), + + TP_fast_assign( + __entry->dev = inode->i_sb->s_dev; + __entry->ino = inode->i_ino; + __entry->index = index; + __entry->ret = ret; + ), + + TP_printk("dev = (%d,%d), ino = %lu, index = %lu, ret = %lx", + show_dev_ino(__entry), + (unsigned long)__entry->index, + __entry->ret) +); + TRACE_EVENT(f2fs_writepages, TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type), @@ -1604,6 +1683,30 @@ DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit, TP_ARGS(sb, type, count) ); +TRACE_EVENT(f2fs_shutdown, + + TP_PROTO(struct f2fs_sb_info *sbi, unsigned int mode, int ret), + + TP_ARGS(sbi, mode, ret), + + TP_STRUCT__entry( + __field(dev_t, dev) + __field(unsigned int, mode) + __field(int, ret) + ), + + TP_fast_assign( + __entry->dev = sbi->sb->s_dev; + __entry->mode = mode; + __entry->ret = ret; + ), + + TP_printk("dev = (%d,%d), mode: %s, ret:%d", + show_dev(__entry->dev), + show_shutdown_mode(__entry->mode), + __entry->ret) +); + #endif /* _TRACE_F2FS_H */ /* This part must be outside protection */ diff --git a/include/trace/events/iommu.h b/include/trace/events/iommu.h index 2c7befb10f13..7b8ba9ffa5a3 100644 --- a/include/trace/events/iommu.h +++ b/include/trace/events/iommu.h @@ -83,6 +83,29 @@ DEFINE_EVENT(iommu_device_event, detach_device_from_domain, TP_ARGS(dev) ); +DECLARE_EVENT_CLASS(iommu_map_unmap, + + TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), + + TP_ARGS(iova, paddr, size), + + TP_STRUCT__entry( + __field(u64, iova) + __field(u64, paddr) + __field(size_t, size) + ), + + TP_fast_assign( + __entry->iova = iova; + __entry->paddr = paddr; + __entry->size = size; + ), + + TP_printk("IOMMU: iova=0x%016llx paddr=0x%016llx size=0x%zx", + __entry->iova, __entry->paddr, __entry->size + ) +); + TRACE_EVENT(map, TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), @@ -129,6 +152,77 @@ TRACE_EVENT(unmap, ) ); +DEFINE_EVENT(iommu_map_unmap, map_start, + + TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), + + TP_ARGS(iova, paddr, size) +); + +DEFINE_EVENT(iommu_map_unmap, map_end, + + TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), + + TP_ARGS(iova, paddr, size) +); + +DEFINE_EVENT_PRINT(iommu_map_unmap, unmap_start, + + TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), + + TP_ARGS(iova, paddr, size), + + TP_printk("IOMMU: iova=0x%016llx size=0x%x", + __entry->iova, __entry->size + ) +); + +DEFINE_EVENT_PRINT(iommu_map_unmap, unmap_end, + + TP_PROTO(unsigned long iova, phys_addr_t paddr, size_t size), + + TP_ARGS(iova, paddr, size), + + TP_printk("IOMMU: iova=0x%016llx size=0x%x", + __entry->iova, __entry->size + ) +); + +DECLARE_EVENT_CLASS(iommu_map_sg, + + TP_PROTO(unsigned long iova, unsigned int nents), + + TP_ARGS(iova, nents), + + TP_STRUCT__entry( + __field(u64, iova) + __field(int, nents) + ), + + TP_fast_assign( + __entry->iova = iova; + __entry->nents = nents; + ), + + TP_printk("IOMMU: iova=0x%016llx nents=%u", + __entry->iova, __entry->nents + ) +); + +DEFINE_EVENT(iommu_map_sg, map_sg_start, + + TP_PROTO(unsigned long iova, unsigned int nents), + + TP_ARGS(iova, nents) +); + +DEFINE_EVENT(iommu_map_sg, map_sg_end, + + TP_PROTO(unsigned long iova, unsigned int nents), + + TP_ARGS(iova, nents) +); + DECLARE_EVENT_CLASS(iommu_error, TP_PROTO(struct device *dev, unsigned long iova, int flags), diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index f7554fd7fc62..ba8c415771b7 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h @@ -351,6 +351,550 @@ TRACE_EVENT(mm_page_alloc_extfrag, __entry->change_ownership) ); + +DECLARE_EVENT_CLASS(ion_alloc, + + TP_PROTO(const char *client_name, + const char *heap_name, + size_t len, + unsigned int mask, + unsigned int flags), + + TP_ARGS(client_name, heap_name, len, mask, flags), + + TP_STRUCT__entry( + __array(char, client_name, 64) + __field(const char *, heap_name) + __field(size_t, len) + __field(unsigned int, mask) + __field(unsigned int, flags) + ), + + TP_fast_assign( + strlcpy(__entry->client_name, client_name, 64); + __entry->heap_name = heap_name; + __entry->len = len; + __entry->mask = mask; + __entry->flags = flags; + ), + + TP_printk("client_name=%s heap_name=%s len=%zu mask=0x%x flags=0x%x", + __entry->client_name, + __entry->heap_name, + __entry->len, + __entry->mask, + __entry->flags) +); + +DEFINE_EVENT(ion_alloc, ion_alloc_buffer_start, + + TP_PROTO(const char *client_name, + const char *heap_name, + size_t len, + unsigned int mask, + unsigned int flags), + + TP_ARGS(client_name, heap_name, len, mask, flags) +); + +DEFINE_EVENT(ion_alloc, ion_alloc_buffer_end, + + TP_PROTO(const char *client_name, + const char *heap_name, + size_t len, + unsigned int mask, + unsigned int flags), + + TP_ARGS(client_name, heap_name, len, mask, flags) +); + +DECLARE_EVENT_CLASS(ion_alloc_error, + + TP_PROTO(const char *client_name, + const char *heap_name, + size_t len, + unsigned int mask, + unsigned int flags, + long error), + + TP_ARGS(client_name, heap_name, len, mask, flags, error), + + TP_STRUCT__entry( + __field(const char *, client_name) + __field(const char *, heap_name) + __field(size_t, len) + __field(unsigned int, mask) + __field(unsigned int, flags) + __field(long, error) + ), + + TP_fast_assign( + __entry->client_name = client_name; + __entry->heap_name = heap_name; + __entry->len = len; + __entry->mask = mask; + __entry->flags = flags; + __entry->error = error; + ), + + TP_printk( + "client_name=%s heap_name=%s len=%zu mask=0x%x flags=0x%x error=%ld", + __entry->client_name, + __entry->heap_name, + __entry->len, + __entry->mask, + __entry->flags, + __entry->error) +); + + +DEFINE_EVENT(ion_alloc_error, ion_alloc_buffer_fallback, + + TP_PROTO(const char *client_name, + const char *heap_name, + size_t len, + unsigned int mask, + unsigned int flags, + long error), + + TP_ARGS(client_name, heap_name, len, mask, flags, error) +); + +DEFINE_EVENT(ion_alloc_error, ion_alloc_buffer_fail, + + TP_PROTO(const char *client_name, + const char *heap_name, + size_t len, + unsigned int mask, + unsigned int flags, + long error), + + TP_ARGS(client_name, heap_name, len, mask, flags, error) +); + + +DECLARE_EVENT_CLASS(alloc_retry, + + TP_PROTO(int tries), + + TP_ARGS(tries), + + TP_STRUCT__entry( + __field(int, tries) + ), + + TP_fast_assign( + __entry->tries = tries; + ), + + TP_printk("tries=%d", + __entry->tries) +); + +DEFINE_EVENT(alloc_retry, ion_cp_alloc_retry, + + TP_PROTO(int tries), + + TP_ARGS(tries) +); + +DEFINE_EVENT(alloc_retry, migrate_retry, + + TP_PROTO(int tries), + + TP_ARGS(tries) +); + +DEFINE_EVENT(alloc_retry, dma_alloc_contiguous_retry, + + TP_PROTO(int tries), + + TP_ARGS(tries) +); + +DECLARE_EVENT_CLASS(migrate_pages, + + TP_PROTO(int mode), + + TP_ARGS(mode), + + TP_STRUCT__entry( + __field(int, mode) + ), + + TP_fast_assign( + __entry->mode = mode; + ), + + TP_printk("mode=%d", + __entry->mode) +); + +DEFINE_EVENT(migrate_pages, migrate_pages_start, + + TP_PROTO(int mode), + + TP_ARGS(mode) +); + +DEFINE_EVENT(migrate_pages, migrate_pages_end, + + TP_PROTO(int mode), + + TP_ARGS(mode) +); + +DECLARE_EVENT_CLASS(ion_alloc_pages, + + TP_PROTO(gfp_t gfp_flags, + unsigned int order), + + TP_ARGS(gfp_flags, order), + + TP_STRUCT__entry( + __field(gfp_t, gfp_flags) + __field(unsigned int, order) + ), + + TP_fast_assign( + __entry->gfp_flags = gfp_flags; + __entry->order = order; + ), + + TP_printk("gfp_flags=%s order=%d", + show_gfp_flags(__entry->gfp_flags), + __entry->order) + ); + +DEFINE_EVENT(ion_alloc_pages, alloc_pages_iommu_start, + TP_PROTO(gfp_t gfp_flags, + unsigned int order), + + TP_ARGS(gfp_flags, order) + ); + +DEFINE_EVENT(ion_alloc_pages, alloc_pages_iommu_end, + TP_PROTO(gfp_t gfp_flags, + unsigned int order), + + TP_ARGS(gfp_flags, order) + ); + +DEFINE_EVENT(ion_alloc_pages, alloc_pages_iommu_fail, + TP_PROTO(gfp_t gfp_flags, + unsigned int order), + + TP_ARGS(gfp_flags, order) + ); + +DEFINE_EVENT(ion_alloc_pages, alloc_pages_sys_start, + TP_PROTO(gfp_t gfp_flags, + unsigned int order), + + TP_ARGS(gfp_flags, order) + ); + +DEFINE_EVENT(ion_alloc_pages, alloc_pages_sys_end, + TP_PROTO(gfp_t gfp_flags, + unsigned int order), + + TP_ARGS(gfp_flags, order) + ); + +DEFINE_EVENT(ion_alloc_pages, alloc_pages_sys_fail, + TP_PROTO(gfp_t gfp_flags, + unsigned int order), + + TP_ARGS(gfp_flags, order) + + ); + +DECLARE_EVENT_CLASS(smmu_map, + + TP_PROTO(unsigned long va, + phys_addr_t pa, + unsigned long chunk_size, + size_t len), + + TP_ARGS(va, pa, chunk_size, len), + + TP_STRUCT__entry( + __field(unsigned long, va) + __field(phys_addr_t, pa) + __field(unsigned long, chunk_size) + __field(size_t, len) + ), + + TP_fast_assign( + __entry->va = va; + __entry->pa = pa; + __entry->chunk_size = chunk_size; + __entry->len = len; + ), + + TP_printk("v_addr=%p p_addr=%pa chunk_size=0x%lu len=%zu", + (void *)__entry->va, + &__entry->pa, + __entry->chunk_size, + __entry->len) + ); + +DEFINE_EVENT(smmu_map, iommu_map_range, + TP_PROTO(unsigned long va, + phys_addr_t pa, + unsigned long chunk_size, + size_t len), + + TP_ARGS(va, pa, chunk_size, len) + ); + +DECLARE_EVENT_CLASS(ion_secure_cma_add_to_pool, + + TP_PROTO(unsigned long len, + int pool_total, + bool is_prefetch), + + TP_ARGS(len, pool_total, is_prefetch), + + TP_STRUCT__entry( + __field(unsigned long, len) + __field(int, pool_total) + __field(bool, is_prefetch) + ), + + TP_fast_assign( + __entry->len = len; + __entry->pool_total = pool_total; + __entry->is_prefetch = is_prefetch; + ), + + TP_printk("len %lx, pool total %x is_prefetch %d", + __entry->len, + __entry->pool_total, + __entry->is_prefetch) + ); + +DEFINE_EVENT(ion_secure_cma_add_to_pool, ion_secure_cma_add_to_pool_start, + TP_PROTO(unsigned long len, + int pool_total, + bool is_prefetch), + + TP_ARGS(len, pool_total, is_prefetch) + ); + +DEFINE_EVENT(ion_secure_cma_add_to_pool, ion_secure_cma_add_to_pool_end, + TP_PROTO(unsigned long len, + int pool_total, + bool is_prefetch), + + TP_ARGS(len, pool_total, is_prefetch) + ); + +DECLARE_EVENT_CLASS(ion_secure_cma_shrink_pool, + + TP_PROTO(unsigned long drained_size, + unsigned long skipped_size), + + TP_ARGS(drained_size, skipped_size), + + TP_STRUCT__entry( + __field(unsigned long, drained_size) + __field(unsigned long, skipped_size) + ), + + TP_fast_assign( + __entry->drained_size = drained_size; + __entry->skipped_size = skipped_size; + ), + + TP_printk("drained size %lx, skipped size %lx", + __entry->drained_size, + __entry->skipped_size) + ); + +DEFINE_EVENT(ion_secure_cma_shrink_pool, ion_secure_cma_shrink_pool_start, + TP_PROTO(unsigned long drained_size, + unsigned long skipped_size), + + TP_ARGS(drained_size, skipped_size) + ); + +DEFINE_EVENT(ion_secure_cma_shrink_pool, ion_secure_cma_shrink_pool_end, + TP_PROTO(unsigned long drained_size, + unsigned long skipped_size), + + TP_ARGS(drained_size, skipped_size) + ); + +TRACE_EVENT(ion_prefetching, + + TP_PROTO(unsigned long len), + + TP_ARGS(len), + + TP_STRUCT__entry( + __field(unsigned long, len) + ), + + TP_fast_assign( + __entry->len = len; + ), + + TP_printk("prefetch size %lx", + __entry->len) + ); + +DECLARE_EVENT_CLASS(ion_secure_cma_allocate, + + TP_PROTO(const char *heap_name, + unsigned long len, + unsigned long align, + unsigned long flags), + + TP_ARGS(heap_name, len, align, flags), + + TP_STRUCT__entry( + __field(const char *, heap_name) + __field(unsigned long, len) + __field(unsigned long, align) + __field(unsigned long, flags) + ), + + TP_fast_assign( + __entry->heap_name = heap_name; + __entry->len = len; + __entry->align = align; + __entry->flags = flags; + ), + + TP_printk("heap_name=%s len=%lx align=%lx flags=%lx", + __entry->heap_name, + __entry->len, + __entry->align, + __entry->flags) + ); + +DEFINE_EVENT(ion_secure_cma_allocate, ion_secure_cma_allocate_start, + TP_PROTO(const char *heap_name, + unsigned long len, + unsigned long align, + unsigned long flags), + + TP_ARGS(heap_name, len, align, flags) + ); + +DEFINE_EVENT(ion_secure_cma_allocate, ion_secure_cma_allocate_end, + TP_PROTO(const char *heap_name, + unsigned long len, + unsigned long align, + unsigned long flags), + + TP_ARGS(heap_name, len, align, flags) + ); + +DECLARE_EVENT_CLASS(ion_cp_secure_buffer, + + TP_PROTO(const char *heap_name, + unsigned long len, + unsigned long align, + unsigned long flags), + + TP_ARGS(heap_name, len, align, flags), + + TP_STRUCT__entry( + __field(const char *, heap_name) + __field(unsigned long, len) + __field(unsigned long, align) + __field(unsigned long, flags) + ), + + TP_fast_assign( + __entry->heap_name = heap_name; + __entry->len = len; + __entry->align = align; + __entry->flags = flags; + ), + + TP_printk("heap_name=%s len=%lx align=%lx flags=%lx", + __entry->heap_name, + __entry->len, + __entry->align, + __entry->flags) + ); + +DEFINE_EVENT(ion_cp_secure_buffer, ion_cp_secure_buffer_start, + TP_PROTO(const char *heap_name, + unsigned long len, + unsigned long align, + unsigned long flags), + + TP_ARGS(heap_name, len, align, flags) + ); + +DEFINE_EVENT(ion_cp_secure_buffer, ion_cp_secure_buffer_end, + TP_PROTO(const char *heap_name, + unsigned long len, + unsigned long align, + unsigned long flags), + + TP_ARGS(heap_name, len, align, flags) + ); + +DECLARE_EVENT_CLASS(iommu_sec_ptbl_map_range, + + TP_PROTO(int sec_id, + int num, + unsigned long va, + unsigned int pa, + size_t len), + + TP_ARGS(sec_id, num, va, pa, len), + + TP_STRUCT__entry( + __field(int, sec_id) + __field(int, num) + __field(unsigned long, va) + __field(unsigned int, pa) + __field(size_t, len) + ), + + TP_fast_assign( + __entry->sec_id = sec_id; + __entry->num = num; + __entry->va = va; + __entry->pa = pa; + __entry->len = len; + ), + + TP_printk("sec_id=%d num=%d va=%lx pa=%u len=%zu", + __entry->sec_id, + __entry->num, + __entry->va, + __entry->pa, + __entry->len) + ); + +DEFINE_EVENT(iommu_sec_ptbl_map_range, iommu_sec_ptbl_map_range_start, + + TP_PROTO(int sec_id, + int num, + unsigned long va, + unsigned int pa, + size_t len), + + TP_ARGS(sec_id, num, va, pa, len) + ); + +DEFINE_EVENT(iommu_sec_ptbl_map_range, iommu_sec_ptbl_map_range_end, + + TP_PROTO(int sec_id, + int num, + unsigned long va, + unsigned int pa, + size_t len), + + TP_ARGS(sec_id, num, va, pa, len) + ); #endif /* _TRACE_KMEM_H */ /* This part must be outside protection */ diff --git a/include/trace/events/migrate.h b/include/trace/events/migrate.h index 539b25a76111..0ee910d5d194 100644 --- a/include/trace/events/migrate.h +++ b/include/trace/events/migrate.h @@ -96,6 +96,27 @@ TRACE_EVENT(mm_numa_migrate_ratelimit, __entry->dst_nid, __entry->nr_pages) ); + +TRACE_EVENT(mm_migrate_pages_start, + + TP_PROTO(enum migrate_mode mode, int reason), + + TP_ARGS(mode, reason), + + TP_STRUCT__entry( + __field(enum migrate_mode, mode) + __field(int, reason) + ), + + TP_fast_assign( + __entry->mode = mode; + __entry->reason = reason; + ), + + TP_printk("mode=%s reason=%s", + __print_symbolic(__entry->mode, MIGRATE_MODE), + __print_symbolic(__entry->reason, MIGRATE_REASON)) +); #endif /* _TRACE_MIGRATE_H */ /* This part must be outside protection */ diff --git a/include/trace/events/mmc.h b/include/trace/events/mmc.h index 82b368dbcefc..30b2113ace6e 100644 --- a/include/trace/events/mmc.h +++ b/include/trace/events/mmc.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2013 Google, Inc. + * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -85,7 +86,153 @@ DEFINE_EVENT_CONDITION(mmc_blk_rw_class, mmc_blk_rw_end, TP_CONDITION(((cmd == MMC_READ_MULTIPLE_BLOCK) || (cmd == MMC_WRITE_MULTIPLE_BLOCK)) && data)); -#endif /* _TRACE_MMC_H */ + +TRACE_EVENT(mmc_cmd_rw_start, + TP_PROTO(unsigned int cmd, unsigned int arg, unsigned int flags), + TP_ARGS(cmd, arg, flags), + TP_STRUCT__entry( + __field(unsigned int, cmd) + __field(unsigned int, arg) + __field(unsigned int, flags) + ), + TP_fast_assign( + __entry->cmd = cmd; + __entry->arg = arg; + __entry->flags = flags; + ), + TP_printk("cmd=%u,arg=0x%08x,flags=0x%08x", + __entry->cmd, __entry->arg, __entry->flags) +); + +TRACE_EVENT(mmc_cmd_rw_end, + TP_PROTO(unsigned int cmd, unsigned int status, unsigned int resp), + TP_ARGS(cmd, status, resp), + TP_STRUCT__entry( + __field(unsigned int, cmd) + __field(unsigned int, status) + __field(unsigned int, resp) + ), + TP_fast_assign( + __entry->cmd = cmd; + __entry->status = status; + __entry->resp = resp; + ), + TP_printk("cmd=%u,int_status=0x%08x,response=0x%08x", + __entry->cmd, __entry->status, __entry->resp) +); + +TRACE_EVENT(mmc_data_rw_end, + TP_PROTO(unsigned int cmd, unsigned int status), + TP_ARGS(cmd, status), + TP_STRUCT__entry( + __field(unsigned int, cmd) + __field(unsigned int, status) + ), + TP_fast_assign( + __entry->cmd = cmd; + __entry->status = status; + ), + TP_printk("cmd=%u,int_status=0x%08x", + __entry->cmd, __entry->status) +); + +DECLARE_EVENT_CLASS(mmc_adma_class, + TP_PROTO(unsigned int cmd, unsigned int len), + TP_ARGS(cmd, len), + TP_STRUCT__entry( + __field(unsigned int, cmd) + __field(unsigned int, len) + ), + TP_fast_assign( + __entry->cmd = cmd; + __entry->len = len; + ), + TP_printk("cmd=%u,sg_len=0x%08x", __entry->cmd, __entry->len) +); + +DEFINE_EVENT(mmc_adma_class, mmc_adma_table_pre, + TP_PROTO(unsigned int cmd, unsigned int len), + TP_ARGS(cmd, len)); + +DEFINE_EVENT(mmc_adma_class, mmc_adma_table_post, + TP_PROTO(unsigned int cmd, unsigned int len), + TP_ARGS(cmd, len)); + +TRACE_EVENT(mmc_clk, + TP_PROTO(char *print_info), + + TP_ARGS(print_info), + + TP_STRUCT__entry( + __string(print_info, print_info) + ), + + TP_fast_assign( + __assign_str(print_info, print_info); + ), + + TP_printk("%s", + __get_str(print_info) + ) +); + +DECLARE_EVENT_CLASS(mmc_pm_template, + TP_PROTO(const char *dev_name, int err, s64 usecs), + + TP_ARGS(dev_name, err, usecs), + + TP_STRUCT__entry( + __field(s64, usecs) + __field(int, err) + __string(dev_name, dev_name) + ), + + TP_fast_assign( + __entry->usecs = usecs; + __entry->err = err; + __assign_str(dev_name, dev_name); + ), + + TP_printk( + "took %lld usecs, %s err %d", + __entry->usecs, + __get_str(dev_name), + __entry->err + ) +); + +DEFINE_EVENT(mmc_pm_template, mmc_runtime_suspend, + TP_PROTO(const char *dev_name, int err, s64 usecs), + TP_ARGS(dev_name, err, usecs)); + +DEFINE_EVENT(mmc_pm_template, mmc_runtime_resume, + TP_PROTO(const char *dev_name, int err, s64 usecs), + TP_ARGS(dev_name, err, usecs)); + +DEFINE_EVENT(mmc_pm_template, mmc_suspend, + TP_PROTO(const char *dev_name, int err, s64 usecs), + TP_ARGS(dev_name, err, usecs)); + +DEFINE_EVENT(mmc_pm_template, mmc_resume, + TP_PROTO(const char *dev_name, int err, s64 usecs), + TP_ARGS(dev_name, err, usecs)); + +DEFINE_EVENT(mmc_pm_template, sdhci_msm_suspend, + TP_PROTO(const char *dev_name, int err, s64 usecs), + TP_ARGS(dev_name, err, usecs)); + +DEFINE_EVENT(mmc_pm_template, sdhci_msm_resume, + TP_PROTO(const char *dev_name, int err, s64 usecs), + TP_ARGS(dev_name, err, usecs)); + +DEFINE_EVENT(mmc_pm_template, sdhci_msm_runtime_suspend, + TP_PROTO(const char *dev_name, int err, s64 usecs), + TP_ARGS(dev_name, err, usecs)); + +DEFINE_EVENT(mmc_pm_template, sdhci_msm_runtime_resume, + TP_PROTO(const char *dev_name, int err, s64 usecs), + TP_ARGS(dev_name, err, usecs)); +#endif /* if !defined(_TRACE_MMC_H) || defined(TRACE_HEADER_MULTI_READ) */ /* This part must be outside protection */ #include <trace/define_trace.h> diff --git a/include/trace/events/msm_cam.h b/include/trace/events/msm_cam.h new file mode 100644 index 000000000000..b0dc7eac8b7a --- /dev/null +++ b/include/trace/events/msm_cam.h @@ -0,0 +1,164 @@ +/* Copyright (c) 2016, 2019, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM msm_cam + +#if !defined(_TRACE_MSM_VFE_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_MSM_VFE_H + +#include "msm_isp.h" +#include <linux/types.h> +#include <linux/tracepoint.h> + +#define STRING_LEN 80 + + +TRACE_EVENT(msm_cam_string, + TP_PROTO(const char *str), + TP_ARGS(str), + TP_STRUCT__entry( + __array(char, str, STRING_LEN) + ), + TP_fast_assign( + strlcpy(__entry->str, str, STRING_LEN); + ), + TP_printk("msm_cam: %s", __entry->str) +); + +TRACE_EVENT(msm_cam_tasklet_debug_dump, + TP_PROTO(struct msm_vfe_irq_debug_info tasklet_state), + TP_ARGS(tasklet_state), + TP_STRUCT__entry( + __field(unsigned int, vfe_id) + __field(unsigned int, core_id) + __field(unsigned int, irq_status0) + __field(unsigned int, irq_status1) + __field(unsigned int, ping_pong_status) + __field(long, tv_sec) + __field(long, tv_usec) + ), + TP_fast_assign( + __entry->vfe_id = tasklet_state.vfe_id; + __entry->irq_status0 = + tasklet_state.irq_status0[tasklet_state.vfe_id]; + __entry->irq_status1 = + tasklet_state.irq_status1[tasklet_state.vfe_id]; + __entry->core_id = tasklet_state.core_id; + __entry->ping_pong_status = + tasklet_state.ping_pong_status[tasklet_state.vfe_id]; + __entry->tv_sec = + tasklet_state.ts.buf_time.tv_sec; + __entry->tv_usec = + tasklet_state.ts.buf_time.tv_usec; + ), + TP_printk("vfe_id %d, core %d, irq_st0 0x%x, irq_st1 0x%x\n" + "pi_po_st 0x%x, time %ld:%ld", + __entry->vfe_id, + __entry->core_id, + __entry->irq_status0, + __entry->irq_status1, + __entry->ping_pong_status, + __entry->tv_sec, + __entry->tv_usec + ) +); + +TRACE_EVENT(msm_cam_ping_pong_debug_dump, + TP_PROTO(struct msm_vfe_irq_debug_info ping_pong_state), + TP_ARGS(ping_pong_state), + TP_STRUCT__entry( + __field(unsigned int, curr_vfe_id) + __field(unsigned int, curr_irq_status0) + __field(unsigned int, curr_irq_status1) + __field(unsigned int, curr_ping_pong_status) + __field(unsigned int, othr_vfe_id) + __field(unsigned int, othr_irq_status0) + __field(unsigned int, othr_irq_status1) + __field(unsigned int, othr_ping_pong_status) + __field(long, othr_tv_sec) + __field(long, othr_tv_usec) + __field(unsigned int, core_id) + ), + TP_fast_assign( + __entry->curr_vfe_id = + ping_pong_state.vfe_id; + __entry->curr_irq_status0 = + ping_pong_state.irq_status0[ping_pong_state.vfe_id]; + __entry->curr_irq_status1 = + ping_pong_state.irq_status1[ping_pong_state.vfe_id]; + __entry->curr_ping_pong_status = + ping_pong_state. + ping_pong_status[ping_pong_state.vfe_id]; + __entry->othr_vfe_id = + !ping_pong_state.vfe_id; + __entry->othr_irq_status0 = + ping_pong_state.irq_status0[!ping_pong_state.vfe_id]; + __entry->othr_irq_status1 = + ping_pong_state.irq_status1[!ping_pong_state.vfe_id]; + __entry->othr_ping_pong_status = + ping_pong_state. + ping_pong_status[!ping_pong_state.vfe_id]; + __entry->othr_tv_sec = + ping_pong_state.ts.buf_time.tv_sec; + __entry->othr_tv_usec = + ping_pong_state.ts.buf_time.tv_usec; + __entry->core_id = ping_pong_state.core_id; + ), + TP_printk("vfe_id %d, irq_st0 0x%x, irq_st1 0x%x, pi_po_st 0x%x\n" + "other vfe_id %d, irq_st0 0x%x, irq_st1 0x%x\n" + "pi_po_st 0x%x, time %ld:%ld core %d", + __entry->curr_vfe_id, + __entry->curr_irq_status0, + __entry->curr_irq_status1, + __entry->curr_ping_pong_status, + __entry->othr_vfe_id, + __entry->othr_irq_status0, + __entry->othr_irq_status1, + __entry->othr_ping_pong_status, + __entry->othr_tv_sec, + __entry->othr_tv_usec, + __entry->core_id + ) +); + +TRACE_EVENT(msm_cam_isp_status_dump, + TP_PROTO(char *event, uint32_t vfe_id, uint32_t frame_id, + uint32_t irq_status0, uint32_t irq_status1), + TP_ARGS(event, vfe_id, frame_id, irq_status0, + irq_status1), + TP_STRUCT__entry( + __field(char *, event) + __field(unsigned int, vfe_id) + __field(unsigned int, frame_id) + __field(unsigned int, irq_status0) + __field(unsigned int, irq_status1) + ), + TP_fast_assign( + __entry->event = event; + __entry->vfe_id = vfe_id; + __entry->frame_id = frame_id; + __entry->irq_status0 = irq_status0; + __entry->irq_status1 = irq_status1; + ), + TP_printk("%s vfe %d, frame %d, irq_st0 %x, irq_st1 %x\n", + __entry->event, + __entry->vfe_id, + __entry->frame_id, + __entry->irq_status0, + __entry->irq_status1 + ) +); + +#endif /* _MSM_CAM_TRACE_H */ +/* This part must be outside protection */ +#include <trace/define_trace.h> diff --git a/include/trace/events/msm_vidc.h b/include/trace/events/msm_vidc.h new file mode 100644 index 000000000000..74283aebb2db --- /dev/null +++ b/include/trace/events/msm_vidc.h @@ -0,0 +1,315 @@ +/* Copyright (c) 2014, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM msm_vidc + +#if !defined(_TRACE_MSM_VIDC_H_) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_MSM_VIDC_H +#include <linux/types.h> +#include <linux/tracepoint.h> + +DECLARE_EVENT_CLASS(msm_v4l2_vidc, + + TP_PROTO(char *dummy), + + TP_ARGS(dummy), + + TP_STRUCT__entry( + __field(char *, dummy) + ), + + TP_fast_assign( + __entry->dummy = dummy; + ), + + TP_printk("%s", __entry->dummy) +); + +DEFINE_EVENT(msm_v4l2_vidc, msm_v4l2_vidc_open_start, + + TP_PROTO(char *dummy), + + TP_ARGS(dummy) +); + +DEFINE_EVENT(msm_v4l2_vidc, msm_v4l2_vidc_open_end, + + TP_PROTO(char *dummy), + + TP_ARGS(dummy) +); + +DEFINE_EVENT(msm_v4l2_vidc, msm_v4l2_vidc_close_start, + + TP_PROTO(char *dummy), + + TP_ARGS(dummy) +); + +DEFINE_EVENT(msm_v4l2_vidc, msm_v4l2_vidc_close_end, + + TP_PROTO(char *dummy), + + TP_ARGS(dummy) +); + +DEFINE_EVENT(msm_v4l2_vidc, msm_v4l2_vidc_fw_load_start, + + TP_PROTO(char *dummy), + + TP_ARGS(dummy) +); + +DEFINE_EVENT(msm_v4l2_vidc, msm_v4l2_vidc_fw_load_end, + + TP_PROTO(char *dummy), + + TP_ARGS(dummy) +); + +DECLARE_EVENT_CLASS(msm_vidc_common, + + TP_PROTO(void *instp, int old_state, int new_state), + + TP_ARGS(instp, old_state, new_state), + + TP_STRUCT__entry( + __field(void *, instp) + __field(int, old_state) + __field(int, new_state) + ), + + TP_fast_assign( + __entry->instp = instp; + __entry->old_state = old_state; + __entry->new_state = new_state; + ), + + TP_printk("Moved inst: %p from 0x%x to 0x%x", + __entry->instp, + __entry->old_state, + __entry->new_state) +); + +DEFINE_EVENT(msm_vidc_common, msm_vidc_common_state_change, + + TP_PROTO(void *instp, int old_state, int new_state), + + TP_ARGS(instp, old_state, new_state) +); + +DECLARE_EVENT_CLASS(venus_hfi_var, + + TP_PROTO(u32 cp_start, u32 cp_size, + u32 cp_nonpixel_start, u32 cp_nonpixel_size), + + TP_ARGS(cp_start, cp_size, cp_nonpixel_start, cp_nonpixel_size), + + TP_STRUCT__entry( + __field(u32, cp_start) + __field(u32, cp_size) + __field(u32, cp_nonpixel_start) + __field(u32, cp_nonpixel_size) + ), + + TP_fast_assign( + __entry->cp_start = cp_start; + __entry->cp_size = cp_size; + __entry->cp_nonpixel_start = cp_nonpixel_start; + __entry->cp_nonpixel_size = cp_nonpixel_size; + ), + + TP_printk( + "TZBSP_MEM_PROTECT_VIDEO_VAR done, cp_start : 0x%x, cp_size : 0x%x, cp_nonpixel_start : 0x%x, cp_nonpixel_size : 0x%x", + __entry->cp_start, + __entry->cp_size, + __entry->cp_nonpixel_start, + __entry->cp_nonpixel_size) +); + +DEFINE_EVENT(venus_hfi_var, venus_hfi_var_done, + + TP_PROTO(u32 cp_start, u32 cp_size, + u32 cp_nonpixel_start, u32 cp_nonpixel_size), + + TP_ARGS(cp_start, cp_size, cp_nonpixel_start, cp_nonpixel_size) +); + +DECLARE_EVENT_CLASS(msm_v4l2_vidc_buffer_events, + + TP_PROTO(char *event_type, u32 device_addr, int64_t timestamp, + u32 alloc_len, u32 filled_len, u32 offset), + + TP_ARGS(event_type, device_addr, timestamp, alloc_len, + filled_len, offset), + + TP_STRUCT__entry( + __field(char *, event_type) + __field(u32, device_addr) + __field(int64_t, timestamp) + __field(u32, alloc_len) + __field(u32, filled_len) + __field(u32, offset) + ), + + TP_fast_assign( + __entry->event_type = event_type; + __entry->device_addr = device_addr; + __entry->timestamp = timestamp; + __entry->alloc_len = alloc_len; + __entry->filled_len = filled_len; + __entry->offset = offset; + ), + + TP_printk( + "%s, device_addr : 0x%x, timestamp : %lld, alloc_len : 0x%x, filled_len : 0x%x, offset : 0x%x", + __entry->event_type, + __entry->device_addr, + __entry->timestamp, + __entry->alloc_len, + __entry->filled_len, + __entry->offset) +); + +DEFINE_EVENT(msm_v4l2_vidc_buffer_events, msm_v4l2_vidc_buffer_event_start, + + TP_PROTO(char *event_type, u32 device_addr, int64_t timestamp, + u32 alloc_len, u32 filled_len, u32 offset), + + TP_ARGS(event_type, device_addr, timestamp, alloc_len, + filled_len, offset) +); + +DEFINE_EVENT(msm_v4l2_vidc_buffer_events, msm_v4l2_vidc_buffer_event_end, + + TP_PROTO(char *event_type, u32 device_addr, int64_t timestamp, + u32 alloc_len, u32 filled_len, u32 offset), + + TP_ARGS(event_type, device_addr, timestamp, alloc_len, + filled_len, offset) +); + +DECLARE_EVENT_CLASS(msm_smem_buffer_ion_ops, + + TP_PROTO(char *buffer_op, u32 buffer_type, u32 heap_mask, + size_t size, u32 align, u32 flags, int map_kernel), + + TP_ARGS(buffer_op, buffer_type, heap_mask, size, align, + flags, map_kernel), + + TP_STRUCT__entry( + __field(char *, buffer_op) + __field(u32, buffer_type) + __field(u32, heap_mask) + __field(u32, size) + __field(u32, align) + __field(u32, flags) + __field(int, map_kernel) + ), + + TP_fast_assign( + __entry->buffer_op = buffer_op; + __entry->buffer_type = buffer_type; + __entry->heap_mask = heap_mask; + __entry->size = size; + __entry->align = align; + __entry->flags = flags; + __entry->map_kernel = map_kernel; + ), + + TP_printk( + "%s, buffer_type : 0x%x, heap_mask : 0x%x, size : 0x%x, align : 0x%x, flags : 0x%x, map_kernel : %d", + __entry->buffer_op, + __entry->buffer_type, + __entry->heap_mask, + __entry->size, + __entry->align, + __entry->flags, + __entry->map_kernel) +); + +DEFINE_EVENT(msm_smem_buffer_ion_ops, msm_smem_buffer_ion_op_start, + + TP_PROTO(char *buffer_op, u32 buffer_type, u32 heap_mask, + size_t size, u32 align, u32 flags, int map_kernel), + + TP_ARGS(buffer_op, buffer_type, heap_mask, size, align, + flags, map_kernel) +); + +DEFINE_EVENT(msm_smem_buffer_ion_ops, msm_smem_buffer_ion_op_end, + + TP_PROTO(char *buffer_op, u32 buffer_type, u32 heap_mask, + size_t size, u32 align, u32 flags, int map_kernel), + + TP_ARGS(buffer_op, buffer_type, heap_mask, size, align, + flags, map_kernel) +); + +DECLARE_EVENT_CLASS(msm_smem_buffer_iommu_ops, + + TP_PROTO(char *buffer_op, int domain_num, int partition_num, + unsigned long align, unsigned long iova, + unsigned long buffer_size), + + TP_ARGS(buffer_op, domain_num, partition_num, align, iova, buffer_size), + + TP_STRUCT__entry( + __field(char *, buffer_op) + __field(int, domain_num) + __field(int, partition_num) + __field(unsigned long, align) + __field(unsigned long, iova) + __field(unsigned long, buffer_size) + ), + + TP_fast_assign( + __entry->buffer_op = buffer_op; + __entry->domain_num = domain_num; + __entry->partition_num = partition_num; + __entry->align = align; + __entry->iova = iova; + __entry->buffer_size = buffer_size; + ), + + TP_printk( + "%s, domain : %d, partition : %d, align : %lx, iova : 0x%lx, buffer_size=%lx", + __entry->buffer_op, + __entry->domain_num, + __entry->partition_num, + __entry->align, + __entry->iova, + __entry->buffer_size) +); + +DEFINE_EVENT(msm_smem_buffer_iommu_ops, msm_smem_buffer_iommu_op_start, + + TP_PROTO(char *buffer_op, int domain_num, int partition_num, + unsigned long align, unsigned long iova, + unsigned long buffer_size), + + TP_ARGS(buffer_op, domain_num, partition_num, align, iova, buffer_size) +); + +DEFINE_EVENT(msm_smem_buffer_iommu_ops, msm_smem_buffer_iommu_op_end, + + TP_PROTO(char *buffer_op, int domain_num, int partition_num, + unsigned long align, unsigned long iova, + unsigned long buffer_size), + + TP_ARGS(buffer_op, domain_num, partition_num, align, iova, buffer_size) +); + +#endif + +#include <trace/define_trace.h> diff --git a/include/trace/events/namei.h b/include/trace/events/namei.h new file mode 100644 index 000000000000..e8c3e216a0a7 --- /dev/null +++ b/include/trace/events/namei.h @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM namei + +#if !defined(_TRACE_INODEPATH_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_INODEPATH_H + +#include <linux/types.h> +#include <linux/tracepoint.h> +#include <linux/mm.h> +#include <linux/memcontrol.h> +#include <linux/device.h> +#include <linux/kdev_t.h> + +TRACE_EVENT(inodepath, + TP_PROTO(struct inode *inode, char *path), + + TP_ARGS(inode, path), + + TP_STRUCT__entry( + /* dev_t and ino_t are arch dependent bit width + * so just use 64-bit + */ + __field(unsigned long, ino) + __field(unsigned long, dev) + __string(path, path) + ), + + TP_fast_assign( + __entry->ino = inode->i_ino; + __entry->dev = inode->i_sb->s_dev; + __assign_str(path, path); + ), + + TP_printk("dev %d:%d ino=%lu path=%s", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, __get_str(path)) +); +#endif /* _TRACE_INODEPATH_H */ + +/* This part must be outside protection */ +#include <trace/define_trace.h> diff --git a/include/trace/events/power.h b/include/trace/events/power.h index 8924cc2b4ca8..19136453a5e2 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h @@ -145,6 +145,48 @@ TRACE_EVENT(cpu_frequency_limits, (unsigned long)__entry->cpu_id) ); +TRACE_EVENT(cpu_frequency_switch_start, + + TP_PROTO(unsigned int start_freq, unsigned int end_freq, + unsigned int cpu_id), + + TP_ARGS(start_freq, end_freq, cpu_id), + + TP_STRUCT__entry( + __field( u32, start_freq ) + __field( u32, end_freq ) + __field( u32, cpu_id ) + ), + + TP_fast_assign( + __entry->start_freq = start_freq; + __entry->end_freq = end_freq; + __entry->cpu_id = cpu_id; + ), + + TP_printk("start=%lu end=%lu cpu_id=%lu", + (unsigned long)__entry->start_freq, + (unsigned long)__entry->end_freq, + (unsigned long)__entry->cpu_id) +); + +TRACE_EVENT(cpu_frequency_switch_end, + + TP_PROTO(unsigned int cpu_id), + + TP_ARGS(cpu_id), + + TP_STRUCT__entry( + __field( u32, cpu_id ) + ), + + TP_fast_assign( + __entry->cpu_id = cpu_id; + ), + + TP_printk("cpu_id=%lu", (unsigned long)__entry->cpu_id) +); + DEFINE_EVENT(cpu, cpu_capacity, TP_PROTO(unsigned int capacity, unsigned int cpu_id), @@ -262,6 +304,7 @@ DEFINE_EVENT(wakeup_source, wakeup_source_deactivate, * The clock events are used for clock enable/disable and for * clock rate change */ +#if defined(CONFIG_COMMON_CLK_MSM) DECLARE_EVENT_CLASS(clock, TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), @@ -305,6 +348,13 @@ DEFINE_EVENT(clock, clock_set_rate, TP_ARGS(name, state, cpu_id) ); +DEFINE_EVENT(clock, clock_set_rate_complete, + + TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), + + TP_ARGS(name, state, cpu_id) +); + TRACE_EVENT(clock_set_parent, TP_PROTO(const char *name, const char *parent_name), @@ -324,6 +374,36 @@ TRACE_EVENT(clock_set_parent, TP_printk("%s parent=%s", __get_str(name), __get_str(parent_name)) ); +TRACE_EVENT(clock_state, + + TP_PROTO(const char *name, unsigned long prepare_count, + unsigned long count, unsigned long rate, + unsigned int vdd_level), + + TP_ARGS(name, prepare_count, count, rate, vdd_level), + + TP_STRUCT__entry( + __string(name, name) + __field(unsigned long, prepare_count) + __field(unsigned long, count) + __field(unsigned long, rate) + __field(unsigned int, vdd_level) + ), + + TP_fast_assign( + __assign_str(name, name); + __entry->prepare_count = prepare_count; + __entry->count = count; + __entry->rate = rate; + __entry->vdd_level = vdd_level; + ), + + TP_printk("%s\tprepare:enable cnt [%lu:%lu]\trate: vdd level [%lu:%u]", + __get_str(name), __entry->prepare_count, + __entry->count, __entry->rate, __entry->vdd_level) +); +#endif /* CONFIG_COMMON_CLK_MSM */ + /* * The power domain events are used for power domains transitions */ @@ -527,6 +607,494 @@ DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_remove_request, TP_ARGS(name, type, new_value) ); + +TRACE_EVENT(bw_hwmon_meas, + + TP_PROTO(const char *name, unsigned long mbps, + unsigned long us, int wake), + + TP_ARGS(name, mbps, us, wake), + + TP_STRUCT__entry( + __string( name, name ) + __field( unsigned long, mbps ) + __field( unsigned long, us ) + __field( int, wake ) + ), + + TP_fast_assign( + __assign_str(name, name); + __entry->mbps = mbps; + __entry->us = us; + __entry->wake = wake; + ), + + TP_printk("dev: %s, mbps = %lu, us = %lu, wake = %d", + __get_str(name), + __entry->mbps, + __entry->us, + __entry->wake) +); + +TRACE_EVENT(bw_hwmon_update, + + TP_PROTO(const char *name, unsigned long mbps, unsigned long freq, + unsigned long up_thres, unsigned long down_thres), + + TP_ARGS(name, mbps, freq, up_thres, down_thres), + + TP_STRUCT__entry( + __string( name, name ) + __field( unsigned long, mbps ) + __field( unsigned long, freq ) + __field( unsigned long, up_thres ) + __field( unsigned long, down_thres ) + ), + + TP_fast_assign( + __assign_str(name, name); + __entry->mbps = mbps; + __entry->freq = freq; + __entry->up_thres = up_thres; + __entry->down_thres = down_thres; + ), + + TP_printk("dev: %s, mbps = %lu, freq = %lu, up = %lu, down = %lu", + __get_str(name), + __entry->mbps, + __entry->freq, + __entry->up_thres, + __entry->down_thres) +); + +TRACE_EVENT(cache_hwmon_meas, + TP_PROTO(const char *name, unsigned long high_mrps, + unsigned long med_mrps, unsigned long low_mrps, + unsigned int busy_percent, unsigned int us), + TP_ARGS(name, high_mrps, med_mrps, low_mrps, busy_percent, us), + TP_STRUCT__entry( + __string(name, name) + __field(unsigned long, high_mrps) + __field(unsigned long, med_mrps) + __field(unsigned long, low_mrps) + __field(unsigned long, total_mrps) + __field(unsigned int, busy_percent) + __field(unsigned int, us) + ), + TP_fast_assign( + __assign_str(name, name); + __entry->high_mrps = high_mrps; + __entry->med_mrps = med_mrps; + __entry->low_mrps = low_mrps; + __entry->total_mrps = high_mrps + med_mrps + low_mrps; + __entry->busy_percent = busy_percent; + __entry->us = us; + ), + TP_printk("dev=%s H=%lu M=%lu L=%lu T=%lu busy_pct=%u period=%u", + __get_str(name), __entry->high_mrps, __entry->med_mrps, + __entry->low_mrps, __entry->total_mrps, + __entry->busy_percent, __entry->us) +); + +TRACE_EVENT(cache_hwmon_update, + TP_PROTO(const char *name, unsigned long freq_mhz), + TP_ARGS(name, freq_mhz), + TP_STRUCT__entry( + __string(name, name) + __field(unsigned long, freq) + ), + TP_fast_assign( + __assign_str(name, name); + __entry->freq = freq_mhz; + ), + TP_printk("dev=%s freq=%lu", __get_str(name), __entry->freq) +); + +TRACE_EVENT(memlat_dev_meas, + + TP_PROTO(const char *name, unsigned int dev_id, unsigned long inst, + unsigned long mem, unsigned long freq, unsigned int ratio), + + TP_ARGS(name, dev_id, inst, mem, freq, ratio), + + TP_STRUCT__entry( + __string(name, name) + __field(unsigned int, dev_id) + __field(unsigned long, inst) + __field(unsigned long, mem) + __field(unsigned long, freq) + __field(unsigned int, ratio) + ), + + TP_fast_assign( + __assign_str(name, name); + __entry->dev_id = dev_id; + __entry->inst = inst; + __entry->mem = mem; + __entry->freq = freq; + __entry->ratio = ratio; + ), + + TP_printk("dev: %s, id=%u, inst=%lu, mem=%lu, freq=%lu, ratio=%u", + __get_str(name), + __entry->dev_id, + __entry->inst, + __entry->mem, + __entry->freq, + __entry->ratio) +); + +TRACE_EVENT(memlat_dev_update, + + TP_PROTO(const char *name, unsigned int dev_id, unsigned long inst, + unsigned long mem, unsigned long freq, unsigned long vote), + + TP_ARGS(name, dev_id, inst, mem, freq, vote), + + TP_STRUCT__entry( + __string(name, name) + __field(unsigned int, dev_id) + __field(unsigned long, inst) + __field(unsigned long, mem) + __field(unsigned long, freq) + __field(unsigned long, vote) + ), + + TP_fast_assign( + __assign_str(name, name); + __entry->dev_id = dev_id; + __entry->inst = inst; + __entry->mem = mem; + __entry->freq = freq; + __entry->vote = vote; + ), + + TP_printk("dev: %s, id=%u, inst=%lu, mem=%lu, freq=%lu, vote=%lu", + __get_str(name), + __entry->dev_id, + __entry->inst, + __entry->mem, + __entry->freq, + __entry->vote) +); + +DECLARE_EVENT_CLASS(kpm_module, + + TP_PROTO(unsigned int managed_cpus, unsigned int max_cpus), + + TP_ARGS(managed_cpus, max_cpus), + + TP_STRUCT__entry( + __field(u32, managed_cpus) + __field(u32, max_cpus) + ), + + TP_fast_assign( + __entry->managed_cpus = managed_cpus; + __entry->max_cpus = max_cpus; + ), + + TP_printk("managed:%x max_cpus=%u", (unsigned int)__entry->managed_cpus, + (unsigned int)__entry->max_cpus) +); + +DEFINE_EVENT(kpm_module, set_max_cpus, + TP_PROTO(unsigned int managed_cpus, unsigned int max_cpus), + TP_ARGS(managed_cpus, max_cpus) +); + +DEFINE_EVENT(kpm_module, reevaluate_hotplug, + TP_PROTO(unsigned int managed_cpus, unsigned int max_cpus), + TP_ARGS(managed_cpus, max_cpus) +); + +DECLARE_EVENT_CLASS(kpm_module2, + + TP_PROTO(unsigned int cpu, unsigned int enter_cycle_cnt, + unsigned int exit_cycle_cnt, + unsigned int io_busy, u64 iowait), + + TP_ARGS(cpu, enter_cycle_cnt, exit_cycle_cnt, io_busy, iowait), + + TP_STRUCT__entry( + __field(u32, cpu) + __field(u32, enter_cycle_cnt) + __field(u32, exit_cycle_cnt) + __field(u32, io_busy) + __field(u64, iowait) + ), + + TP_fast_assign( + __entry->cpu = cpu; + __entry->enter_cycle_cnt = enter_cycle_cnt; + __entry->exit_cycle_cnt = exit_cycle_cnt; + __entry->io_busy = io_busy; + __entry->iowait = iowait; + ), + + TP_printk("CPU:%u enter_cycles=%u exit_cycles=%u io_busy=%u iowait=%lu", + (unsigned int)__entry->cpu, + (unsigned int)__entry->enter_cycle_cnt, + (unsigned int)__entry->exit_cycle_cnt, + (unsigned int)__entry->io_busy, + (unsigned long)__entry->iowait) +); + +DEFINE_EVENT(kpm_module2, track_iowait, + TP_PROTO(unsigned int cpu, unsigned int enter_cycle_cnt, + unsigned int exit_cycle_cnt, unsigned int io_busy, u64 iowait), + TP_ARGS(cpu, enter_cycle_cnt, exit_cycle_cnt, io_busy, iowait) +); + +DECLARE_EVENT_CLASS(cpu_modes, + + TP_PROTO(unsigned int cpu, unsigned int max_load, + unsigned int single_enter_cycle_cnt, + unsigned int single_exit_cycle_cnt, + unsigned int total_load, unsigned int multi_enter_cycle_cnt, + unsigned int multi_exit_cycle_cnt, + unsigned int perf_cl_peak_enter_cycle_cnt, + unsigned int perf_cl_peak_exit_cycle_cnt, + unsigned int mode, + unsigned int cpu_cnt), + + TP_ARGS(cpu, max_load, single_enter_cycle_cnt, single_exit_cycle_cnt, + total_load, multi_enter_cycle_cnt, multi_exit_cycle_cnt, + perf_cl_peak_enter_cycle_cnt, perf_cl_peak_exit_cycle_cnt, mode, + cpu_cnt), + + TP_STRUCT__entry( + __field(u32, cpu) + __field(u32, max_load) + __field(u32, single_enter_cycle_cnt) + __field(u32, single_exit_cycle_cnt) + __field(u32, total_load) + __field(u32, multi_enter_cycle_cnt) + __field(u32, multi_exit_cycle_cnt) + __field(u32, perf_cl_peak_enter_cycle_cnt) + __field(u32, perf_cl_peak_exit_cycle_cnt) + __field(u32, mode) + __field(u32, cpu_cnt) + ), + + TP_fast_assign( + __entry->cpu = cpu; + __entry->max_load = max_load; + __entry->single_enter_cycle_cnt = single_enter_cycle_cnt; + __entry->single_exit_cycle_cnt = single_exit_cycle_cnt; + __entry->total_load = total_load; + __entry->multi_enter_cycle_cnt = multi_enter_cycle_cnt; + __entry->multi_exit_cycle_cnt = multi_exit_cycle_cnt; + __entry->perf_cl_peak_enter_cycle_cnt = + perf_cl_peak_enter_cycle_cnt; + __entry->perf_cl_peak_exit_cycle_cnt = + perf_cl_peak_exit_cycle_cnt; + __entry->mode = mode; + __entry->cpu_cnt = cpu_cnt; + ), + + TP_printk("%u:%4u:%4u:%4u:%4u:%4u:%4u:%4u:%4u:%4u:%u", + (unsigned int)__entry->cpu, (unsigned int)__entry->max_load, + (unsigned int)__entry->single_enter_cycle_cnt, + (unsigned int)__entry->single_exit_cycle_cnt, + (unsigned int)__entry->total_load, + (unsigned int)__entry->multi_enter_cycle_cnt, + (unsigned int)__entry->multi_exit_cycle_cnt, + (unsigned int)__entry->perf_cl_peak_enter_cycle_cnt, + (unsigned int)__entry->perf_cl_peak_exit_cycle_cnt, + (unsigned int)__entry->mode, + (unsigned int)__entry->cpu_cnt) +); + +DEFINE_EVENT(cpu_modes, cpu_mode_detect, + TP_PROTO(unsigned int cpu, unsigned int max_load, + unsigned int single_enter_cycle_cnt, + unsigned int single_exit_cycle_cnt, + unsigned int total_load, unsigned int multi_enter_cycle_cnt, + unsigned int multi_exit_cycle_cnt, + unsigned int perf_cl_peak_enter_cycle_cnt, + unsigned int perf_cl_peak_exit_cycle_cnt, + unsigned int mode, + unsigned int cpu_cnt), + TP_ARGS(cpu, max_load, single_enter_cycle_cnt, single_exit_cycle_cnt, + total_load, multi_enter_cycle_cnt, multi_exit_cycle_cnt, + perf_cl_peak_enter_cycle_cnt, perf_cl_peak_exit_cycle_cnt, + mode, cpu_cnt) +); + +DECLARE_EVENT_CLASS(timer_status, + TP_PROTO(unsigned int cpu, unsigned int single_enter_cycles, + unsigned int single_enter_cycle_cnt, + unsigned int single_exit_cycles, + unsigned int single_exit_cycle_cnt, + unsigned int multi_enter_cycles, + unsigned int multi_enter_cycle_cnt, + unsigned int multi_exit_cycles, + unsigned int multi_exit_cycle_cnt, unsigned int timer_rate, + unsigned int mode), + TP_ARGS(cpu, single_enter_cycles, single_enter_cycle_cnt, + single_exit_cycles, single_exit_cycle_cnt, multi_enter_cycles, + multi_enter_cycle_cnt, multi_exit_cycles, + multi_exit_cycle_cnt, timer_rate, mode), + + TP_STRUCT__entry( + __field(unsigned int, cpu) + __field(unsigned int, single_enter_cycles) + __field(unsigned int, single_enter_cycle_cnt) + __field(unsigned int, single_exit_cycles) + __field(unsigned int, single_exit_cycle_cnt) + __field(unsigned int, multi_enter_cycles) + __field(unsigned int, multi_enter_cycle_cnt) + __field(unsigned int, multi_exit_cycles) + __field(unsigned int, multi_exit_cycle_cnt) + __field(unsigned int, timer_rate) + __field(unsigned int, mode) + ), + + TP_fast_assign( + __entry->cpu = cpu; + __entry->single_enter_cycles = single_enter_cycles; + __entry->single_enter_cycle_cnt = single_enter_cycle_cnt; + __entry->single_exit_cycles = single_exit_cycles; + __entry->single_exit_cycle_cnt = single_exit_cycle_cnt; + __entry->multi_enter_cycles = multi_enter_cycles; + __entry->multi_enter_cycle_cnt = multi_enter_cycle_cnt; + __entry->multi_exit_cycles = multi_exit_cycles; + __entry->multi_exit_cycle_cnt = multi_exit_cycle_cnt; + __entry->timer_rate = timer_rate; + __entry->mode = mode; + ), + + TP_printk("%u:%4u:%4u:%4u:%4u:%4u:%4u:%4u:%4u:%4u:%4u", + (unsigned int) __entry->cpu, + (unsigned int) __entry->single_enter_cycles, + (unsigned int) __entry->single_enter_cycle_cnt, + (unsigned int) __entry->single_exit_cycles, + (unsigned int) __entry->single_exit_cycle_cnt, + (unsigned int) __entry->multi_enter_cycles, + (unsigned int) __entry->multi_enter_cycle_cnt, + (unsigned int) __entry->multi_exit_cycles, + (unsigned int) __entry->multi_exit_cycle_cnt, + (unsigned int) __entry->timer_rate, + (unsigned int) __entry->mode) +); + +DEFINE_EVENT(timer_status, single_mode_timeout, + TP_PROTO(unsigned int cpu, unsigned int single_enter_cycles, + unsigned int single_enter_cycle_cnt, + unsigned int single_exit_cycles, + unsigned int single_exit_cycle_cnt, + unsigned int multi_enter_cycles, + unsigned int multi_enter_cycle_cnt, + unsigned int multi_exit_cycles, + unsigned int multi_exit_cycle_cnt, unsigned int timer_rate, + unsigned int mode), + TP_ARGS(cpu, single_enter_cycles, single_enter_cycle_cnt, + single_exit_cycles, single_exit_cycle_cnt, multi_enter_cycles, + multi_enter_cycle_cnt, multi_exit_cycles, multi_exit_cycle_cnt, + timer_rate, mode) +); + +DEFINE_EVENT(timer_status, single_cycle_exit_timer_start, + TP_PROTO(unsigned int cpu, unsigned int single_enter_cycles, + unsigned int single_enter_cycle_cnt, + unsigned int single_exit_cycles, + unsigned int single_exit_cycle_cnt, + unsigned int multi_enter_cycles, + unsigned int multi_enter_cycle_cnt, + unsigned int multi_exit_cycles, + unsigned int multi_exit_cycle_cnt, unsigned int timer_rate, + unsigned int mode), + TP_ARGS(cpu, single_enter_cycles, single_enter_cycle_cnt, + single_exit_cycles, single_exit_cycle_cnt, multi_enter_cycles, + multi_enter_cycle_cnt, multi_exit_cycles, multi_exit_cycle_cnt, + timer_rate, mode) +); + +DEFINE_EVENT(timer_status, single_cycle_exit_timer_stop, + TP_PROTO(unsigned int cpu, unsigned int single_enter_cycles, + unsigned int single_enter_cycle_cnt, + unsigned int single_exit_cycles, + unsigned int single_exit_cycle_cnt, + unsigned int multi_enter_cycles, + unsigned int multi_enter_cycle_cnt, + unsigned int multi_exit_cycles, + unsigned int multi_exit_cycle_cnt, unsigned int timer_rate, + unsigned int mode), + TP_ARGS(cpu, single_enter_cycles, single_enter_cycle_cnt, + single_exit_cycles, single_exit_cycle_cnt, multi_enter_cycles, + multi_enter_cycle_cnt, multi_exit_cycles, multi_exit_cycle_cnt, + timer_rate, mode) +); + +DECLARE_EVENT_CLASS(perf_cl_peak_timer_status, + TP_PROTO(unsigned int cpu, unsigned int perf_cl_peak_enter_cycles, + unsigned int perf_cl_peak_enter_cycle_cnt, + unsigned int perf_cl_peak_exit_cycles, + unsigned int perf_cl_peak_exit_cycle_cnt, + unsigned int timer_rate, + unsigned int mode), + TP_ARGS(cpu, perf_cl_peak_enter_cycles, perf_cl_peak_enter_cycle_cnt, + perf_cl_peak_exit_cycles, perf_cl_peak_exit_cycle_cnt, + timer_rate, mode), + + TP_STRUCT__entry( + __field(unsigned int, cpu) + __field(unsigned int, perf_cl_peak_enter_cycles) + __field(unsigned int, perf_cl_peak_enter_cycle_cnt) + __field(unsigned int, perf_cl_peak_exit_cycles) + __field(unsigned int, perf_cl_peak_exit_cycle_cnt) + __field(unsigned int, timer_rate) + __field(unsigned int, mode) + ), + + TP_fast_assign( + __entry->cpu = cpu; + __entry->perf_cl_peak_enter_cycles = perf_cl_peak_enter_cycles; + __entry->perf_cl_peak_enter_cycle_cnt = + perf_cl_peak_enter_cycle_cnt; + __entry->perf_cl_peak_exit_cycles = perf_cl_peak_exit_cycles; + __entry->perf_cl_peak_exit_cycle_cnt = + perf_cl_peak_exit_cycle_cnt; + __entry->timer_rate = timer_rate; + __entry->mode = mode; + ), + + TP_printk("%u:%4u:%4u:%4u:%4u:%4u:%4u", + (unsigned int) __entry->cpu, + (unsigned int) __entry->perf_cl_peak_enter_cycles, + (unsigned int) __entry->perf_cl_peak_enter_cycle_cnt, + (unsigned int) __entry->perf_cl_peak_exit_cycles, + (unsigned int) __entry->perf_cl_peak_exit_cycle_cnt, + (unsigned int) __entry->timer_rate, + (unsigned int) __entry->mode) +); + +DEFINE_EVENT(perf_cl_peak_timer_status, perf_cl_peak_exit_timer_start, + TP_PROTO(unsigned int cpu, unsigned int perf_cl_peak_enter_cycles, + unsigned int perf_cl_peak_enter_cycle_cnt, + unsigned int perf_cl_peak_exit_cycles, + unsigned int perf_cl_peak_exit_cycle_cnt, + unsigned int timer_rate, + unsigned int mode), + TP_ARGS(cpu, perf_cl_peak_enter_cycles, perf_cl_peak_enter_cycle_cnt, + perf_cl_peak_exit_cycles, perf_cl_peak_exit_cycle_cnt, + timer_rate, mode) +); + + +DEFINE_EVENT(perf_cl_peak_timer_status, perf_cl_peak_exit_timer_stop, + TP_PROTO(unsigned int cpu, unsigned int perf_cl_peak_enter_cycles, + unsigned int perf_cl_peak_enter_cycle_cnt, + unsigned int perf_cl_peak_exit_cycles, + unsigned int perf_cl_peak_exit_cycle_cnt, + unsigned int timer_rate, + unsigned int mode), + TP_ARGS(cpu, perf_cl_peak_enter_cycles, perf_cl_peak_enter_cycle_cnt, + perf_cl_peak_exit_cycles, perf_cl_peak_exit_cycle_cnt, + timer_rate, mode) +); + #endif /* _TRACE_POWER_H */ /* This part must be outside protection */ diff --git a/include/trace/events/preemptirq.h b/include/trace/events/preemptirq.h index 9c4eb33c5a1d..3c5118011a2c 100644 --- a/include/trace/events/preemptirq.h +++ b/include/trace/events/preemptirq.h @@ -52,6 +52,34 @@ DEFINE_EVENT(preemptirq_template, preempt_enable, TP_ARGS(ip, parent_ip)); #endif +TRACE_EVENT(irqs_disable, + + TP_PROTO(u64 delta, unsigned long caddr0, unsigned long caddr1, + unsigned long caddr2, unsigned long caddr3), + + TP_ARGS(delta, caddr0, caddr1, caddr2, caddr3), + + TP_STRUCT__entry( + __field(u64, delta) + __field(void*, caddr0) + __field(void*, caddr1) + __field(void*, caddr2) + __field(void*, caddr3) + ), + + TP_fast_assign( + __entry->delta = delta; + __entry->caddr0 = (void *)caddr0; + __entry->caddr1 = (void *)caddr1; + __entry->caddr2 = (void *)caddr2; + __entry->caddr3 = (void *)caddr3; + ), + + TP_printk("delta=%llu(ns) Callers:(%pf<-%pf<-%pf<-%pf)", __entry->delta, + __entry->caddr0, __entry->caddr1, + __entry->caddr2, __entry->caddr3) +); + #endif /* _TRACE_PREEMPTIRQ_H */ #include <trace/define_trace.h> diff --git a/include/trace/events/process_reclaim.h b/include/trace/events/process_reclaim.h new file mode 100644 index 000000000000..6fcede793747 --- /dev/null +++ b/include/trace/events/process_reclaim.h @@ -0,0 +1,85 @@ +/* Copyright (c) 2015, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM process_reclaim + +#if !defined(_TRACE_EVENT_PROCESSRECLAIM_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_EVENT_PROCESSRECLAIM_H + +#include <linux/tracepoint.h> +#include <linux/types.h> +#include <linux/sched.h> + +TRACE_EVENT(process_reclaim, + + TP_PROTO(int tasksize, + short oom_score_adj, + int nr_scanned, int nr_reclaimed, + int per_swap_size, int total_sz, + int nr_to_reclaim), + + TP_ARGS(tasksize, oom_score_adj, nr_scanned, + nr_reclaimed, per_swap_size, + total_sz, nr_to_reclaim), + + TP_STRUCT__entry( + __field(int, tasksize) + __field(short, oom_score_adj) + __field(int, nr_scanned) + __field(int, nr_reclaimed) + __field(int, per_swap_size) + __field(int, total_sz) + __field(int, nr_to_reclaim) + ), + + TP_fast_assign( + __entry->tasksize = tasksize; + __entry->oom_score_adj = oom_score_adj; + __entry->nr_scanned = nr_scanned; + __entry->nr_reclaimed = nr_reclaimed; + __entry->per_swap_size = per_swap_size; + __entry->total_sz = total_sz; + __entry->nr_to_reclaim = nr_to_reclaim; + ), + + TP_printk("%d, %hd, %d, %d, %d, %d, %d", + __entry->tasksize, __entry->oom_score_adj, + __entry->nr_scanned, __entry->nr_reclaimed, + __entry->per_swap_size, __entry->total_sz, + __entry->nr_to_reclaim) +); + +TRACE_EVENT(process_reclaim_eff, + + TP_PROTO(int efficiency, int reclaim_avg_efficiency), + + TP_ARGS(efficiency, reclaim_avg_efficiency), + + TP_STRUCT__entry( + __field(int, efficiency) + __field(int, reclaim_avg_efficiency) + ), + + TP_fast_assign( + __entry->efficiency = efficiency; + __entry->reclaim_avg_efficiency = reclaim_avg_efficiency; + ), + + TP_printk("%d, %d", __entry->efficiency, + __entry->reclaim_avg_efficiency) +); + +#endif + +#include <trace/define_trace.h> + diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 9f7fd0c6662b..73cd7e502d4c 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -8,6 +8,8 @@ #include <linux/tracepoint.h> #include <linux/binfmts.h> +struct rq; + /* * Tracepoint for calling kthread_stop, performed to end a kthread: */ @@ -51,6 +53,653 @@ TRACE_EVENT(sched_kthread_stop_ret, ); /* + * Tracepoint for task enqueue/dequeue: + */ +TRACE_EVENT(sched_enq_deq_task, + + TP_PROTO(struct task_struct *p, bool enqueue, unsigned int cpus_allowed), + + TP_ARGS(p, enqueue, cpus_allowed), + + TP_STRUCT__entry( + __array( char, comm, TASK_COMM_LEN ) + __field( pid_t, pid ) + __field( int, prio ) + __field( int, cpu ) + __field( bool, enqueue ) + __field(unsigned int, nr_running ) + __field(unsigned long, cpu_load ) + __field(unsigned int, rt_nr_running ) + __field(unsigned int, cpus_allowed ) +#ifdef CONFIG_SCHED_HMP + __field(unsigned int, demand ) + __field(unsigned int, pred_demand ) +#endif + ), + + TP_fast_assign( + memcpy(__entry->comm, p->comm, TASK_COMM_LEN); + __entry->pid = p->pid; + __entry->prio = p->prio; + __entry->cpu = task_cpu(p); + __entry->enqueue = enqueue; + __entry->nr_running = task_rq(p)->nr_running; + __entry->cpu_load = task_rq(p)->cpu_load[0]; + __entry->rt_nr_running = task_rq(p)->rt.rt_nr_running; + __entry->cpus_allowed = cpus_allowed; +#ifdef CONFIG_SCHED_HMP + __entry->demand = p->ravg.demand; + __entry->pred_demand = p->ravg.pred_demand; +#endif + ), + + TP_printk("cpu=%d %s comm=%s pid=%d prio=%d nr_running=%u cpu_load=%lu rt_nr_running=%u affine=%x" +#ifdef CONFIG_SCHED_HMP + " demand=%u pred_demand=%u" +#endif + , __entry->cpu, + __entry->enqueue ? "enqueue" : "dequeue", + __entry->comm, __entry->pid, + __entry->prio, __entry->nr_running, + __entry->cpu_load, __entry->rt_nr_running, __entry->cpus_allowed +#ifdef CONFIG_SCHED_HMP + , __entry->demand, __entry->pred_demand +#endif + ) +); + +#ifdef CONFIG_SCHED_HMP + +struct group_cpu_time; +struct migration_sum_data; +extern const char *task_event_names[]; +extern const char *migrate_type_names[]; + +TRACE_EVENT(sched_task_load, + + TP_PROTO(struct task_struct *p, bool boost, int reason, + bool sync, bool need_idle, u32 flags, int best_cpu), + + TP_ARGS(p, boost, reason, sync, need_idle, flags, best_cpu), + + TP_STRUCT__entry( + __array( char, comm, TASK_COMM_LEN ) + __field( pid_t, pid ) + __field(unsigned int, demand ) + __field( bool, boost ) + __field( int, reason ) + __field( bool, sync ) + __field( bool, need_idle ) + __field( u32, flags ) + __field( int, best_cpu ) + __field( u64, latency ) + __field( int, grp_id ) + __field( u64, avg_burst ) + __field( u64, avg_sleep ) + ), + + TP_fast_assign( + memcpy(__entry->comm, p->comm, TASK_COMM_LEN); + __entry->pid = p->pid; + __entry->demand = p->ravg.demand; + __entry->boost = boost; + __entry->reason = reason; + __entry->sync = sync; + __entry->need_idle = need_idle; + __entry->flags = flags; + __entry->best_cpu = best_cpu; + __entry->latency = p->state == TASK_WAKING ? + sched_ktime_clock() - + p->ravg.mark_start : 0; + __entry->grp_id = p->grp ? p->grp->id : 0; + __entry->avg_burst = p->ravg.avg_burst; + __entry->avg_sleep = p->ravg.avg_sleep_time; + ), + + TP_printk("%d (%s): demand=%u boost=%d reason=%d sync=%d need_idle=%d flags=%x grp=%d best_cpu=%d latency=%llu avg_burst=%llu avg_sleep=%llu", + __entry->pid, __entry->comm, __entry->demand, + __entry->boost, __entry->reason, __entry->sync, + __entry->need_idle, __entry->flags, __entry->grp_id, + __entry->best_cpu, __entry->latency, __entry->avg_burst, + __entry->avg_sleep) +); + +TRACE_EVENT(sched_set_preferred_cluster, + + TP_PROTO(struct related_thread_group *grp, u64 total_demand), + + TP_ARGS(grp, total_demand), + + TP_STRUCT__entry( + __field( int, id ) + __field( u64, demand ) + __field( int, cluster_first_cpu ) + __array( char, comm, TASK_COMM_LEN ) + __field( pid_t, pid ) + __field(unsigned int, task_demand ) + ), + + TP_fast_assign( + __entry->id = grp->id; + __entry->demand = total_demand; + __entry->cluster_first_cpu = grp->preferred_cluster ? + cluster_first_cpu(grp->preferred_cluster) + : -1; + ), + + TP_printk("group_id %d total_demand %llu preferred_cluster_first_cpu %d", + __entry->id, __entry->demand, + __entry->cluster_first_cpu) +); + +DECLARE_EVENT_CLASS(sched_cpu_load, + + TP_PROTO(struct rq *rq, int idle, u64 irqload, unsigned int power_cost, int temp), + + TP_ARGS(rq, idle, irqload, power_cost, temp), + + TP_STRUCT__entry( + __field(unsigned int, cpu ) + __field(unsigned int, idle ) + __field(unsigned int, nr_running ) + __field(unsigned int, nr_big_tasks ) + __field(unsigned int, load_scale_factor ) + __field(unsigned int, capacity ) + __field( u64, cumulative_runnable_avg ) + __field( u64, irqload ) + __field(unsigned int, max_freq ) + __field(unsigned int, power_cost ) + __field( int, cstate ) + __field( int, dstate ) + __field( int, temp ) + ), + + TP_fast_assign( + __entry->cpu = rq->cpu; + __entry->idle = idle; + __entry->nr_running = rq->nr_running; + __entry->nr_big_tasks = rq->hmp_stats.nr_big_tasks; + __entry->load_scale_factor = cpu_load_scale_factor(rq->cpu); + __entry->capacity = cpu_capacity(rq->cpu); + __entry->cumulative_runnable_avg = rq->hmp_stats.cumulative_runnable_avg; + __entry->irqload = irqload; + __entry->max_freq = cpu_max_freq(rq->cpu); + __entry->power_cost = power_cost; + __entry->cstate = rq->cstate; + __entry->dstate = rq->cluster->dstate; + __entry->temp = temp; + ), + + TP_printk("cpu %u idle %d nr_run %u nr_big %u lsf %u capacity %u cr_avg %llu irqload %llu fmax %u power_cost %u cstate %d dstate %d temp %d", + __entry->cpu, __entry->idle, __entry->nr_running, __entry->nr_big_tasks, + __entry->load_scale_factor, __entry->capacity, + __entry->cumulative_runnable_avg, __entry->irqload, + __entry->max_freq, __entry->power_cost, __entry->cstate, + __entry->dstate, __entry->temp) +); + +DEFINE_EVENT(sched_cpu_load, sched_cpu_load_wakeup, + TP_PROTO(struct rq *rq, int idle, u64 irqload, unsigned int power_cost, int temp), + TP_ARGS(rq, idle, irqload, power_cost, temp) +); + +DEFINE_EVENT(sched_cpu_load, sched_cpu_load_lb, + TP_PROTO(struct rq *rq, int idle, u64 irqload, unsigned int power_cost, int temp), + TP_ARGS(rq, idle, irqload, power_cost, temp) +); + +DEFINE_EVENT(sched_cpu_load, sched_cpu_load_cgroup, + TP_PROTO(struct rq *rq, int idle, u64 irqload, unsigned int power_cost, int temp), + TP_ARGS(rq, idle, irqload, power_cost, temp) +); + +TRACE_EVENT(sched_set_boost, + + TP_PROTO(int type), + + TP_ARGS(type), + + TP_STRUCT__entry( + __field(int, type ) + ), + + TP_fast_assign( + __entry->type = type; + ), + + TP_printk("type %d", __entry->type) +); + +#if defined(CREATE_TRACE_POINTS) && defined(CONFIG_SCHED_HMP) +static inline void __window_data(u32 *dst, u32 *src) +{ + if (src) + memcpy(dst, src, nr_cpu_ids * sizeof(u32)); + else + memset(dst, 0, nr_cpu_ids * sizeof(u32)); +} + +struct trace_seq; +const char *__window_print(struct trace_seq *p, const u32 *buf, int buf_len) +{ + int i; + const char *ret = p->buffer + seq_buf_used(&p->seq); + + for (i = 0; i < buf_len; i++) + trace_seq_printf(p, "%u ", buf[i]); + + trace_seq_putc(p, 0); + + return ret; +} + +static inline s64 __rq_update_sum(struct rq *rq, bool curr, bool new) +{ + if (curr) + if (new) + return rq->nt_curr_runnable_sum; + else + return rq->curr_runnable_sum; + else + if (new) + return rq->nt_prev_runnable_sum; + else + return rq->prev_runnable_sum; +} + +static inline s64 __grp_update_sum(struct rq *rq, bool curr, bool new) +{ + if (curr) + if (new) + return rq->grp_time.nt_curr_runnable_sum; + else + return rq->grp_time.curr_runnable_sum; + else + if (new) + return rq->grp_time.nt_prev_runnable_sum; + else + return rq->grp_time.prev_runnable_sum; +} + +static inline s64 +__get_update_sum(struct rq *rq, enum migrate_types migrate_type, + bool src, bool new, bool curr) +{ + switch (migrate_type) { + case RQ_TO_GROUP: + if (src) + return __rq_update_sum(rq, curr, new); + else + return __grp_update_sum(rq, curr, new); + case GROUP_TO_RQ: + if (src) + return __grp_update_sum(rq, curr, new); + else + return __rq_update_sum(rq, curr, new); + default: + WARN_ON_ONCE(1); + return -1; + } +} +#endif + +TRACE_EVENT(sched_update_task_ravg, + + TP_PROTO(struct task_struct *p, struct rq *rq, enum task_event evt, + u64 wallclock, u64 irqtime, u64 cycles, u64 exec_time, + struct group_cpu_time *cpu_time), + + TP_ARGS(p, rq, evt, wallclock, irqtime, cycles, exec_time, cpu_time), + + TP_STRUCT__entry( + __array( char, comm, TASK_COMM_LEN ) + __field( pid_t, pid ) + __field( pid_t, cur_pid ) + __field(unsigned int, cur_freq ) + __field( u64, wallclock ) + __field( u64, mark_start ) + __field( u64, delta_m ) + __field( u64, win_start ) + __field( u64, delta ) + __field( u64, irqtime ) + __field(enum task_event, evt ) + __field(unsigned int, demand ) + __field(unsigned int, sum ) + __field( int, cpu ) + __field(unsigned int, pred_demand ) + __field( u64, rq_cs ) + __field( u64, rq_ps ) + __field( u64, grp_cs ) + __field( u64, grp_ps ) + __field( u64, grp_nt_cs ) + __field( u64, grp_nt_ps ) + __field( u32, curr_window ) + __field( u32, prev_window ) + __dynamic_array(u32, curr_sum, nr_cpu_ids ) + __dynamic_array(u32, prev_sum, nr_cpu_ids ) + __field( u64, nt_cs ) + __field( u64, nt_ps ) + __field( u32, active_windows ) + __field( u8, curr_top ) + __field( u8, prev_top ) + ), + + TP_fast_assign( + __entry->wallclock = wallclock; + __entry->win_start = rq->window_start; + __entry->delta = (wallclock - rq->window_start); + __entry->evt = evt; + __entry->cpu = rq->cpu; + __entry->cur_pid = rq->curr->pid; + __entry->cur_freq = cpu_cycles_to_freq(cycles, exec_time); + memcpy(__entry->comm, p->comm, TASK_COMM_LEN); + __entry->pid = p->pid; + __entry->mark_start = p->ravg.mark_start; + __entry->delta_m = (wallclock - p->ravg.mark_start); + __entry->demand = p->ravg.demand; + __entry->sum = p->ravg.sum; + __entry->irqtime = irqtime; + __entry->pred_demand = p->ravg.pred_demand; + __entry->rq_cs = rq->curr_runnable_sum; + __entry->rq_ps = rq->prev_runnable_sum; + __entry->grp_cs = cpu_time ? cpu_time->curr_runnable_sum : 0; + __entry->grp_ps = cpu_time ? cpu_time->prev_runnable_sum : 0; + __entry->grp_nt_cs = cpu_time ? cpu_time->nt_curr_runnable_sum : 0; + __entry->grp_nt_ps = cpu_time ? cpu_time->nt_prev_runnable_sum : 0; + __entry->curr_window = p->ravg.curr_window; + __entry->prev_window = p->ravg.prev_window; + __window_data(__get_dynamic_array(curr_sum), p->ravg.curr_window_cpu); + __window_data(__get_dynamic_array(prev_sum), p->ravg.prev_window_cpu); + __entry->nt_cs = rq->nt_curr_runnable_sum; + __entry->nt_ps = rq->nt_prev_runnable_sum; + __entry->active_windows = p->ravg.active_windows; + __entry->curr_top = rq->curr_top; + __entry->prev_top = rq->prev_top; + ), + + TP_printk("wc %llu ws %llu delta %llu event %s cpu %d cur_freq %u cur_pid %d task %d (%s) ms %llu delta %llu demand %u sum %u irqtime %llu pred_demand %u rq_cs %llu rq_ps %llu cur_window %u (%s) prev_window %u (%s) nt_cs %llu nt_ps %llu active_wins %u grp_cs %lld grp_ps %lld, grp_nt_cs %llu, grp_nt_ps: %llu curr_top %u prev_top %u", + __entry->wallclock, __entry->win_start, __entry->delta, + task_event_names[__entry->evt], __entry->cpu, + __entry->cur_freq, __entry->cur_pid, + __entry->pid, __entry->comm, __entry->mark_start, + __entry->delta_m, __entry->demand, + __entry->sum, __entry->irqtime, __entry->pred_demand, + __entry->rq_cs, __entry->rq_ps, __entry->curr_window, + __window_print(p, __get_dynamic_array(curr_sum), nr_cpu_ids), + __entry->prev_window, + __window_print(p, __get_dynamic_array(prev_sum), nr_cpu_ids), + __entry->nt_cs, __entry->nt_ps, + __entry->active_windows, __entry->grp_cs, + __entry->grp_ps, __entry->grp_nt_cs, __entry->grp_nt_ps, + __entry->curr_top, __entry->prev_top) +); + +TRACE_EVENT(sched_get_task_cpu_cycles, + + TP_PROTO(int cpu, int event, u64 cycles, u64 exec_time, struct task_struct *p), + + TP_ARGS(cpu, event, cycles, exec_time, p), + + TP_STRUCT__entry( + __field(int, cpu ) + __field(int, event ) + __field(u64, cycles ) + __field(u64, exec_time ) + __field(u32, freq ) + __field(u32, legacy_freq ) + __field(u32, max_freq) + __field(pid_t, pid ) + __array(char, comm, TASK_COMM_LEN ) + ), + + TP_fast_assign( + __entry->cpu = cpu; + __entry->event = event; + __entry->cycles = cycles; + __entry->exec_time = exec_time; + __entry->freq = cpu_cycles_to_freq(cycles, exec_time); + __entry->legacy_freq = cpu_cur_freq(cpu); + __entry->max_freq = cpu_max_freq(cpu); + __entry->pid = p->pid; + memcpy(__entry->comm, p->comm, TASK_COMM_LEN); + ), + + TP_printk("cpu=%d event=%d cycles=%llu exec_time=%llu freq=%u legacy_freq=%u max_freq=%u task=%d (%s)", + __entry->cpu, __entry->event, __entry->cycles, + __entry->exec_time, __entry->freq, __entry->legacy_freq, + __entry->max_freq, __entry->pid, __entry->comm) +); + +TRACE_EVENT(sched_update_history, + + TP_PROTO(struct rq *rq, struct task_struct *p, u32 runtime, int samples, + enum task_event evt), + + TP_ARGS(rq, p, runtime, samples, evt), + + TP_STRUCT__entry( + __array( char, comm, TASK_COMM_LEN ) + __field( pid_t, pid ) + __field(unsigned int, runtime ) + __field( int, samples ) + __field(enum task_event, evt ) + __field(unsigned int, demand ) + __field(unsigned int, pred_demand ) + __array( u32, hist, RAVG_HIST_SIZE_MAX) + __field(unsigned int, nr_big_tasks ) + __field( int, cpu ) + ), + + TP_fast_assign( + memcpy(__entry->comm, p->comm, TASK_COMM_LEN); + __entry->pid = p->pid; + __entry->runtime = runtime; + __entry->samples = samples; + __entry->evt = evt; + __entry->demand = p->ravg.demand; + __entry->pred_demand = p->ravg.pred_demand; + memcpy(__entry->hist, p->ravg.sum_history, + RAVG_HIST_SIZE_MAX * sizeof(u32)); + __entry->nr_big_tasks = rq->hmp_stats.nr_big_tasks; + __entry->cpu = rq->cpu; + ), + + TP_printk("%d (%s): runtime %u samples %d event %s demand %u pred_demand %u" + " (hist: %u %u %u %u %u) cpu %d nr_big %u", + __entry->pid, __entry->comm, + __entry->runtime, __entry->samples, + task_event_names[__entry->evt], + __entry->demand, __entry->pred_demand, + __entry->hist[0], __entry->hist[1], + __entry->hist[2], __entry->hist[3], + __entry->hist[4], __entry->cpu, __entry->nr_big_tasks) +); + +TRACE_EVENT(sched_reset_all_window_stats, + + TP_PROTO(u64 window_start, u64 window_size, u64 time_taken, + int reason, unsigned int old_val, unsigned int new_val), + + TP_ARGS(window_start, window_size, time_taken, + reason, old_val, new_val), + + TP_STRUCT__entry( + __field( u64, window_start ) + __field( u64, window_size ) + __field( u64, time_taken ) + __field( int, reason ) + __field(unsigned int, old_val ) + __field(unsigned int, new_val ) + ), + + TP_fast_assign( + __entry->window_start = window_start; + __entry->window_size = window_size; + __entry->time_taken = time_taken; + __entry->reason = reason; + __entry->old_val = old_val; + __entry->new_val = new_val; + ), + + TP_printk("time_taken %llu window_start %llu window_size %llu reason %s old_val %u new_val %u", + __entry->time_taken, __entry->window_start, + __entry->window_size, + sched_window_reset_reasons[__entry->reason], + __entry->old_val, __entry->new_val) +); + +TRACE_EVENT(sched_update_pred_demand, + + TP_PROTO(struct rq *rq, struct task_struct *p, u32 runtime, int pct, + unsigned int pred_demand), + + TP_ARGS(rq, p, runtime, pct, pred_demand), + + TP_STRUCT__entry( + __array( char, comm, TASK_COMM_LEN ) + __field( pid_t, pid ) + __field(unsigned int, runtime ) + __field( int, pct ) + __field(unsigned int, pred_demand ) + __array( u8, bucket, NUM_BUSY_BUCKETS) + __field( int, cpu ) + ), + + TP_fast_assign( + memcpy(__entry->comm, p->comm, TASK_COMM_LEN); + __entry->pid = p->pid; + __entry->runtime = runtime; + __entry->pct = pct; + __entry->pred_demand = pred_demand; + memcpy(__entry->bucket, p->ravg.busy_buckets, + NUM_BUSY_BUCKETS * sizeof(u8)); + __entry->cpu = rq->cpu; + ), + + TP_printk("%d (%s): runtime %u pct %d cpu %d pred_demand %u (buckets: %u %u %u %u %u %u %u %u %u %u)", + __entry->pid, __entry->comm, + __entry->runtime, __entry->pct, __entry->cpu, + __entry->pred_demand, __entry->bucket[0], __entry->bucket[1], + __entry->bucket[2], __entry->bucket[3],__entry->bucket[4], + __entry->bucket[5], __entry->bucket[6], __entry->bucket[7], + __entry->bucket[8], __entry->bucket[9]) +); + +TRACE_EVENT(sched_migration_update_sum, + + TP_PROTO(struct task_struct *p, enum migrate_types migrate_type, struct rq *rq), + + TP_ARGS(p, migrate_type, rq), + + TP_STRUCT__entry( + __field(int, tcpu ) + __field(int, pid ) + __field(enum migrate_types, migrate_type ) + __field( s64, src_cs ) + __field( s64, src_ps ) + __field( s64, dst_cs ) + __field( s64, dst_ps ) + __field( s64, src_nt_cs ) + __field( s64, src_nt_ps ) + __field( s64, dst_nt_cs ) + __field( s64, dst_nt_ps ) + ), + + TP_fast_assign( + __entry->tcpu = task_cpu(p); + __entry->pid = p->pid; + __entry->migrate_type = migrate_type; + __entry->src_cs = __get_update_sum(rq, migrate_type, + true, false, true); + __entry->src_ps = __get_update_sum(rq, migrate_type, + true, false, false); + __entry->dst_cs = __get_update_sum(rq, migrate_type, + false, false, true); + __entry->dst_ps = __get_update_sum(rq, migrate_type, + false, false, false); + __entry->src_nt_cs = __get_update_sum(rq, migrate_type, + true, true, true); + __entry->src_nt_ps = __get_update_sum(rq, migrate_type, + true, true, false); + __entry->dst_nt_cs = __get_update_sum(rq, migrate_type, + false, true, true); + __entry->dst_nt_ps = __get_update_sum(rq, migrate_type, + false, true, false); + ), + + TP_printk("pid %d task_cpu %d migrate_type %s src_cs %llu src_ps %llu dst_cs %lld dst_ps %lld src_nt_cs %llu src_nt_ps %llu dst_nt_cs %lld dst_nt_ps %lld", + __entry->pid, __entry->tcpu, migrate_type_names[__entry->migrate_type], + __entry->src_cs, __entry->src_ps, __entry->dst_cs, __entry->dst_ps, + __entry->src_nt_cs, __entry->src_nt_ps, __entry->dst_nt_cs, __entry->dst_nt_ps) +); + +TRACE_EVENT(sched_get_busy, + + TP_PROTO(int cpu, u64 load, u64 nload, u64 pload, int early, bool aggregated), + + TP_ARGS(cpu, load, nload, pload, early, aggregated), + + TP_STRUCT__entry( + __field( int, cpu ) + __field( u64, load ) + __field( u64, nload ) + __field( u64, pload ) + __field( int, early ) + __field( bool, aggregated ) + ), + + TP_fast_assign( + __entry->cpu = cpu; + __entry->load = load; + __entry->nload = nload; + __entry->pload = pload; + __entry->early = early; + __entry->aggregated = aggregated; + ), + + TP_printk("cpu %d load %lld new_task_load %lld predicted_load %lld early %d aggregated %d", + __entry->cpu, __entry->load, __entry->nload, + __entry->pload, __entry->early, __entry->aggregated) +); + +TRACE_EVENT(sched_freq_alert, + + TP_PROTO(int cpu, int pd_notif, int check_groups, struct rq *rq, + u64 new_load), + + TP_ARGS(cpu, pd_notif, check_groups, rq, new_load), + + TP_STRUCT__entry( + __field( int, cpu ) + __field( int, pd_notif ) + __field( int, check_groups ) + __field( u64, old_busy_time ) + __field( u64, ps ) + __field( u64, new_load ) + __field( u64, old_pred ) + __field( u64, new_pred ) + ), + + TP_fast_assign( + __entry->cpu = cpu; + __entry->pd_notif = pd_notif; + __entry->check_groups = check_groups; + __entry->old_busy_time = rq->old_busy_time; + __entry->ps = rq->prev_runnable_sum; + __entry->new_load = new_load; + __entry->old_pred = rq->old_estimated_time; + __entry->new_pred = rq->hmp_stats.pred_demands_sum; + ), + + TP_printk("cpu %d pd_notif=%d check_groups %d old_busy_time=%llu prev_sum=%lld new_load=%llu old_pred=%llu new_pred=%llu", + __entry->cpu, __entry->pd_notif, __entry->check_groups, + __entry->old_busy_time, __entry->ps, __entry->new_load, + __entry->old_pred, __entry->new_pred) +); + +#endif /* CONFIG_SCHED_HMP */ + +/* * Tracepoint for waking up a task: */ DECLARE_EVENT_CLASS(sched_wakeup_template, @@ -166,14 +815,16 @@ TRACE_EVENT(sched_switch, */ TRACE_EVENT(sched_migrate_task, - TP_PROTO(struct task_struct *p, int dest_cpu), + TP_PROTO(struct task_struct *p, int dest_cpu, + unsigned int load), - TP_ARGS(p, dest_cpu), + TP_ARGS(p, dest_cpu, load), TP_STRUCT__entry( __array( char, comm, TASK_COMM_LEN ) __field( pid_t, pid ) __field( int, prio ) + __field(unsigned int, load ) __field( int, orig_cpu ) __field( int, dest_cpu ) ), @@ -182,12 +833,13 @@ TRACE_EVENT(sched_migrate_task, memcpy(__entry->comm, p->comm, TASK_COMM_LEN); __entry->pid = p->pid; __entry->prio = p->prio; + __entry->load = load; __entry->orig_cpu = task_cpu(p); __entry->dest_cpu = dest_cpu; ), - TP_printk("comm=%s pid=%d prio=%d orig_cpu=%d dest_cpu=%d", - __entry->comm, __entry->pid, __entry->prio, + TP_printk("comm=%s pid=%d prio=%d load=%d orig_cpu=%d dest_cpu=%d", + __entry->comm, __entry->pid, __entry->prio, __entry->load, __entry->orig_cpu, __entry->dest_cpu) ); @@ -216,6 +868,56 @@ TRACE_EVENT(sched_cpu_hotplug, __entry->status ? "online" : "offline", __entry->error) ); +/* + * Tracepoint for load balancing: + */ +#if NR_CPUS > 32 +#error "Unsupported NR_CPUS for lb tracepoint." +#endif +TRACE_EVENT(sched_load_balance, + + TP_PROTO(int cpu, enum cpu_idle_type idle, int balance, + unsigned long group_mask, int busiest_nr_running, + unsigned long imbalance, unsigned int env_flags, int ld_moved, + unsigned int balance_interval), + + TP_ARGS(cpu, idle, balance, group_mask, busiest_nr_running, + imbalance, env_flags, ld_moved, balance_interval), + + TP_STRUCT__entry( + __field( int, cpu) + __field( enum cpu_idle_type, idle) + __field( int, balance) + __field( unsigned long, group_mask) + __field( int, busiest_nr_running) + __field( unsigned long, imbalance) + __field( unsigned int, env_flags) + __field( int, ld_moved) + __field( unsigned int, balance_interval) + ), + + TP_fast_assign( + __entry->cpu = cpu; + __entry->idle = idle; + __entry->balance = balance; + __entry->group_mask = group_mask; + __entry->busiest_nr_running = busiest_nr_running; + __entry->imbalance = imbalance; + __entry->env_flags = env_flags; + __entry->ld_moved = ld_moved; + __entry->balance_interval = balance_interval; + ), + + TP_printk("cpu=%d state=%s balance=%d group=%#lx busy_nr=%d imbalance=%ld flags=%#x ld_moved=%d bal_int=%d", + __entry->cpu, + __entry->idle == CPU_IDLE ? "idle" : + (__entry->idle == CPU_NEWLY_IDLE ? "newly_idle" : "busy"), + __entry->balance, + __entry->group_mask, __entry->busiest_nr_running, + __entry->imbalance, __entry->env_flags, __entry->ld_moved, + __entry->balance_interval) +); + DECLARE_EVENT_CLASS(sched_process_template, TP_PROTO(struct task_struct *p), @@ -612,6 +1314,162 @@ TRACE_EVENT(sched_wake_idle_without_ipi, TP_printk("cpu=%d", __entry->cpu) ); +TRACE_EVENT(sched_get_nr_running_avg, + + TP_PROTO(int avg, int big_avg, int iowait_avg, + unsigned int max_nr, unsigned int big_max_nr), + + TP_ARGS(avg, big_avg, iowait_avg, max_nr, big_max_nr), + + TP_STRUCT__entry( + __field( int, avg ) + __field( int, big_avg ) + __field( int, iowait_avg ) + __field( unsigned int, max_nr ) + __field( unsigned int, big_max_nr ) + ), + + TP_fast_assign( + __entry->avg = avg; + __entry->big_avg = big_avg; + __entry->iowait_avg = iowait_avg; + __entry->max_nr = max_nr; + __entry->big_max_nr = big_max_nr; + ), + + TP_printk("avg=%d big_avg=%d iowait_avg=%d max_nr=%u big_max_nr=%u", + __entry->avg, __entry->big_avg, __entry->iowait_avg, + __entry->max_nr, __entry->big_max_nr) +); + +TRACE_EVENT(core_ctl_eval_need, + + TP_PROTO(unsigned int cpu, unsigned int old_need, + unsigned int new_need, unsigned int updated), + TP_ARGS(cpu, old_need, new_need, updated), + TP_STRUCT__entry( + __field(u32, cpu) + __field(u32, old_need) + __field(u32, new_need) + __field(u32, updated) + ), + TP_fast_assign( + __entry->cpu = cpu; + __entry->old_need = old_need; + __entry->new_need = new_need; + __entry->updated = updated; + ), + TP_printk("cpu=%u, old_need=%u, new_need=%u, updated=%u", __entry->cpu, + __entry->old_need, __entry->new_need, __entry->updated) +); + +TRACE_EVENT(core_ctl_set_busy, + + TP_PROTO(unsigned int cpu, unsigned int busy, + unsigned int old_is_busy, unsigned int is_busy), + TP_ARGS(cpu, busy, old_is_busy, is_busy), + TP_STRUCT__entry( + __field(u32, cpu) + __field(u32, busy) + __field(u32, old_is_busy) + __field(u32, is_busy) + __field(bool, high_irqload) + ), + TP_fast_assign( + __entry->cpu = cpu; + __entry->busy = busy; + __entry->old_is_busy = old_is_busy; + __entry->is_busy = is_busy; + __entry->high_irqload = sched_cpu_high_irqload(cpu); + ), + TP_printk("cpu=%u, busy=%u, old_is_busy=%u, new_is_busy=%u high_irqload=%d", + __entry->cpu, __entry->busy, __entry->old_is_busy, + __entry->is_busy, __entry->high_irqload) +); + +TRACE_EVENT(core_ctl_set_boost, + + TP_PROTO(u32 refcount, s32 ret), + TP_ARGS(refcount, ret), + TP_STRUCT__entry( + __field(u32, refcount) + __field(s32, ret) + ), + TP_fast_assign( + __entry->refcount = refcount; + __entry->ret = ret; + ), + TP_printk("refcount=%u, ret=%d", __entry->refcount, __entry->ret) +); + +/** + * sched_isolate - called when cores are isolated/unisolated + * + * @acutal_mask: mask of cores actually isolated/unisolated + * @req_mask: mask of cores requested isolated/unisolated + * @online_mask: cpu online mask + * @time: amount of time in us it took to isolate/unisolate + * @isolate: 1 if isolating, 0 if unisolating + * + */ +TRACE_EVENT(sched_isolate, + + TP_PROTO(unsigned int requested_cpu, unsigned int isolated_cpus, + u64 start_time, unsigned char isolate), + + TP_ARGS(requested_cpu, isolated_cpus, start_time, isolate), + + TP_STRUCT__entry( + __field(u32, requested_cpu) + __field(u32, isolated_cpus) + __field(u32, time) + __field(unsigned char, isolate) + ), + + TP_fast_assign( + __entry->requested_cpu = requested_cpu; + __entry->isolated_cpus = isolated_cpus; + __entry->time = div64_u64(sched_clock() - start_time, 1000); + __entry->isolate = isolate; + ), + + TP_printk("iso cpu=%u cpus=0x%x time=%u us isolated=%d", + __entry->requested_cpu, __entry->isolated_cpus, + __entry->time, __entry->isolate) +); + +TRACE_EVENT(sched_preempt_disable, + + TP_PROTO(u64 delta, bool irqs_disabled, + unsigned long caddr0, unsigned long caddr1, + unsigned long caddr2, unsigned long caddr3), + + TP_ARGS(delta, irqs_disabled, caddr0, caddr1, caddr2, caddr3), + + TP_STRUCT__entry( + __field(u64, delta) + __field(bool, irqs_disabled) + __field(void*, caddr0) + __field(void*, caddr1) + __field(void*, caddr2) + __field(void*, caddr3) + ), + + TP_fast_assign( + __entry->delta = delta; + __entry->irqs_disabled = irqs_disabled; + __entry->caddr0 = (void *)caddr0; + __entry->caddr1 = (void *)caddr1; + __entry->caddr2 = (void *)caddr2; + __entry->caddr3 = (void *)caddr3; + ), + + TP_printk("delta=%llu(ns) irqs_d=%d Callers:(%pf<-%pf<-%pf<-%pf)", + __entry->delta, __entry->irqs_disabled, + __entry->caddr0, __entry->caddr1, + __entry->caddr2, __entry->caddr3) +); + TRACE_EVENT(sched_contrib_scale_f, TP_PROTO(int cpu, unsigned long freq_scale_factor, @@ -1130,8 +1988,7 @@ TRACE_EVENT(walt_update_history, __entry->samples = samples; __entry->evt = evt; __entry->demand = p->ravg.demand; - __entry->walt_avg = (__entry->demand << 10); - do_div(__entry->walt_avg, walt_ravg_window); + __entry->walt_avg = (__entry->demand << 10) / walt_ravg_window, __entry->pelt_avg = p->se.avg.util_avg; memcpy(__entry->hist, p->ravg.sum_history, RAVG_HIST_SIZE_MAX * sizeof(u32)); diff --git a/include/trace/events/scm.h b/include/trace/events/scm.h new file mode 100644 index 000000000000..b07a38da24bd --- /dev/null +++ b/include/trace/events/scm.h @@ -0,0 +1,68 @@ +/* Copyright (c) 2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM scm + +#if !defined(_TRACE_SCM_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_SCM_H +#include <linux/types.h> +#include <linux/tracepoint.h> +#include <soc/qcom/scm.h> + +TRACE_EVENT(scm_call_start, + + TP_PROTO(u64 x0, struct scm_desc *p), + + TP_ARGS(x0, p), + + TP_STRUCT__entry( + __field(u64, x0) + __field(u32, arginfo) + __array(u64, args, MAX_SCM_ARGS) + __field(u64, x5) + ), + + TP_fast_assign( + __entry->x0 = x0; + __entry->arginfo = p->arginfo; + memcpy(__entry->args, p->args, MAX_SCM_ARGS); + __entry->x5 = p->x5; + ), + + TP_printk("func id=%#llx (args: %#x, %#llx, %#llx, %#llx, %#llx)", + __entry->x0, __entry->arginfo, __entry->args[0], + __entry->args[1], __entry->args[2], __entry->x5) +); + + +TRACE_EVENT(scm_call_end, + + TP_PROTO(struct scm_desc *p), + + TP_ARGS(p), + + TP_STRUCT__entry( + __array(u64, ret, MAX_SCM_RETS) + ), + + TP_fast_assign( + memcpy(__entry->ret, p->ret, MAX_SCM_RETS); + ), + + TP_printk("ret: %#llx, %#llx, %#llx", + __entry->ret[0], __entry->ret[1], __entry->ret[2]) +); +#endif /* _TRACE_SCM_H */ + +/* This part must be outside protection */ +#include <trace/define_trace.h> diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h index 0c68ae22da22..b2e3c3b91f72 100644 --- a/include/trace/events/skb.h +++ b/include/trace/events/skb.h @@ -50,6 +50,33 @@ TRACE_EVENT(consume_skb, TP_printk("skbaddr=%p", __entry->skbaddr) ); +TRACE_EVENT(print_skb_gso, + + TP_PROTO(struct sk_buff *skb, __be16 src, __be16 dest), + + TP_ARGS(skb, src, dest), + + TP_STRUCT__entry( + __field(void *, skbaddr) + __field(int , len) + __field(int , data_len) + __field(__be16, src) + __field(__be16, dest) + ), + + TP_fast_assign( + __entry->skbaddr = skb; + __entry->len = skb->len; + __entry->data_len = skb->data_len; + __entry->src = src; + __entry->dest = dest; + ), + + TP_printk("GSO: skbaddr=%pK, len=%d, data_len=%d, src=%u, dest=%u", + __entry->skbaddr, __entry->len, __entry->data_len, + be16_to_cpu(__entry->src), be16_to_cpu(__entry->dest)) +); + TRACE_EVENT(skb_copy_datagram_iovec, TP_PROTO(const struct sk_buff *skb, int len), diff --git a/include/trace/events/trace_msm_bus.h b/include/trace/events/trace_msm_bus.h new file mode 100644 index 000000000000..3f56fc1e80fb --- /dev/null +++ b/include/trace/events/trace_msm_bus.h @@ -0,0 +1,275 @@ +/* Copyright (c) 2014-2015, 2017, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM msm_bus + +#if !defined(_TRACE_MSM_BUS_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_MSM_BUS_H + +#include <linux/tracepoint.h> + +TRACE_EVENT(bus_update_request, + + TP_PROTO(int sec, int nsec, const char *name, int src, int dest, + unsigned long long ab, unsigned long long ib), + + TP_ARGS(sec, nsec, name, src, dest, ab, ib), + + TP_STRUCT__entry( + __field(int, sec) + __field(int, nsec) + __string(name, name) + __field(int, src) + __field(int, dest) + __field(u64, ab) + __field(u64, ib) + ), + + TP_fast_assign( + __entry->sec = sec; + __entry->nsec = nsec; + __assign_str(name, name); + __entry->src = src; + __entry->dest = dest; + __entry->ab = ab; + __entry->ib = ib; + ), + + TP_printk("time= %u.%09u name=%s src=%d dest=%d ab=%llu ib=%llu", + __entry->sec, + __entry->nsec, + __get_str(name), + __entry->src, + __entry->dest, + (unsigned long long)__entry->ab, + (unsigned long long)__entry->ib) +); + +TRACE_EVENT(bus_update_request_end, + + TP_PROTO(const char *name), + + TP_ARGS(name), + + TP_STRUCT__entry( + __string(name, name) + ), + + TP_fast_assign( + __assign_str(name, name); + ), + + TP_printk("client-name=%s", __get_str(name)) +); + +TRACE_EVENT(bus_max_votes, + + TP_PROTO(int sec, int nsec, const char *bus_name, const char *ctx, + const char *bw_type_name, unsigned long long bw, + const char *cl_name), + + TP_ARGS(sec, nsec, bus_name, ctx, bw_type_name, bw, cl_name), + + TP_STRUCT__entry( + __field(int, sec) + __field(int, nsec) + __string(bus_name, bus_name) + __string(ctx, ctx) + __string(bw_type_name, bw_type_name) + __field(u64, bw) + __string(cl_name, cl_name) + ), + + TP_fast_assign( + __entry->sec = sec; + __entry->nsec = nsec; + __assign_str(bus_name, bus_name); + __assign_str(ctx, ctx); + __assign_str(bw_type_name, bw_type_name); + __entry->bw = bw; + __assign_str(cl_name, cl_name); + ), + + TP_printk("time= %u.%09u %s: %s max_%s: %llu: client-name: %s", + __entry->sec, + __entry->nsec, + __get_str(bus_name), + __get_str(ctx), + __get_str(bw_type_name), + (unsigned long long)__entry->bw, + __get_str(cl_name)) +); + +TRACE_EVENT(bus_bimc_config_limiter, + + TP_PROTO(int mas_id, unsigned long long cur_lim_bw), + + TP_ARGS(mas_id, cur_lim_bw), + + TP_STRUCT__entry( + __field(int, mas_id) + __field(u64, cur_lim_bw) + ), + + TP_fast_assign( + __entry->mas_id = mas_id; + __entry->cur_lim_bw = cur_lim_bw; + ), + + TP_printk("Master=%d cur_lim_bw=%llu", + __entry->mas_id, + (unsigned long long)__entry->cur_lim_bw) +); + +TRACE_EVENT(bus_avail_bw, + + TP_PROTO(unsigned long long cur_bimc_bw, unsigned long long cur_mdp_bw), + + TP_ARGS(cur_bimc_bw, cur_mdp_bw), + + TP_STRUCT__entry( + __field(u64, cur_bimc_bw) + __field(u64, cur_mdp_bw) + ), + + TP_fast_assign( + __entry->cur_bimc_bw = cur_bimc_bw; + __entry->cur_mdp_bw = cur_mdp_bw; + ), + + TP_printk("cur_bimc_bw = %llu cur_mdp_bw = %llu", + (unsigned long long)__entry->cur_bimc_bw, + (unsigned long long)__entry->cur_mdp_bw) +); + +TRACE_EVENT(bus_rules_matches, + + TP_PROTO(int node_id, int rule_id, unsigned long long node_ab, + unsigned long long node_ib, unsigned long long node_clk), + + TP_ARGS(node_id, rule_id, node_ab, node_ib, node_clk), + + TP_STRUCT__entry( + __field(int, node_id) + __field(int, rule_id) + __field(u64, node_ab) + __field(u64, node_ib) + __field(u64, node_clk) + ), + + TP_fast_assign( + __entry->node_id = node_id; + __entry->rule_id = rule_id; + __entry->node_ab = node_ab; + __entry->node_ib = node_ib; + __entry->node_clk = node_clk; + ), + + TP_printk("Rule match node%d rule%d node-ab%llu:ib%llu:clk%llu", + __entry->node_id, __entry->rule_id, + (unsigned long long)__entry->node_ab, + (unsigned long long)__entry->node_ib, + (unsigned long long)__entry->node_clk) +); + +TRACE_EVENT(bus_bke_params, + + TP_PROTO(u32 gc, u32 gp, u32 thl, u32 thm, u32 thh), + + TP_ARGS(gc, gp, thl, thm, thh), + + TP_STRUCT__entry( + __field(u32, gc) + __field(u32, gp) + __field(u32, thl) + __field(u32, thm) + __field(u32, thh) + ), + + TP_fast_assign( + __entry->gc = gc; + __entry->gp = gp; + __entry->thl = thl; + __entry->thm = thm; + __entry->thh = thh; + ), + + TP_printk("BKE Params GC=0x%x GP=0x%x THL=0x%x THM=0x%x THH=0x%x", + __entry->gc, __entry->gp, __entry->thl, __entry->thm, + __entry->thh) +); + +TRACE_EVENT(bus_client_status, + + TP_PROTO(const char *name, int src, int dest, + unsigned long long ab, unsigned long long ib, int active_only), + + TP_ARGS(name, src, dest, ab, ib, active_only), + + TP_STRUCT__entry( + __string(name, name) + __field(int, src) + __field(int, dest) + __field(u64, ab) + __field(u64, ib) + __field(int, active_only) + ), + + TP_fast_assign( + __assign_str(name, name); + __entry->src = src; + __entry->dest = dest; + __entry->ab = ab; + __entry->ib = ib; + __entry->active_only = active_only; + ), + + TP_printk("name=%s src=%d dest=%d ab=%llu ib=%llu active_only=%d", + __get_str(name), + __entry->src, + __entry->dest, + (unsigned long long)__entry->ab, + (unsigned long long)__entry->ib, + __entry->active_only) +); + +TRACE_EVENT(bus_agg_bw, + + TP_PROTO(unsigned int node_id, int rpm_id, int ctx_set, + unsigned long long agg_ab), + + TP_ARGS(node_id, rpm_id, ctx_set, agg_ab), + + TP_STRUCT__entry( + __field(unsigned int, node_id) + __field(int, rpm_id) + __field(int, ctx_set) + __field(u64, agg_ab) + ), + + TP_fast_assign( + __entry->node_id = node_id; + __entry->rpm_id = rpm_id; + __entry->ctx_set = ctx_set; + __entry->agg_ab = agg_ab; + ), + + TP_printk("node_id:%u rpm_id:%d rpm_ctx:%d agg_ab:%llu", + __entry->node_id, + __entry->rpm_id, + __entry->ctx_set, + (unsigned long long)__entry->agg_ab) +); +#endif +#define TRACE_INCLUDE_FILE trace_msm_bus +#include <trace/define_trace.h> diff --git a/include/trace/events/trace_msm_core.h b/include/trace/events/trace_msm_core.h new file mode 100644 index 000000000000..d99b72ca63fa --- /dev/null +++ b/include/trace/events/trace_msm_core.h @@ -0,0 +1,103 @@ +/* Copyright (c) 2014, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM msm_core + +#if !defined(_TRACE_MSM_CORE_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_MSM_CORE_H + +#include <linux/tracepoint.h> +#include <linux/thermal.h> + +TRACE_EVENT(cpu_stats, + + TP_PROTO(unsigned int cpu, long temp, + uint64_t min_power, uint64_t max_power), + + TP_ARGS(cpu, temp, min_power, max_power), + + TP_STRUCT__entry( + __field(unsigned int, cpu) + __field(long, temp) + __field(uint64_t, min_power) + __field(uint64_t, max_power) + ), + + TP_fast_assign( + __entry->cpu = cpu; + __entry->temp = temp; + __entry->min_power = min_power; + __entry->max_power = max_power; + ), + + TP_printk("Cpu%d: temp:%ld power@minfreq:%llu power@maxfreq:%llu", + __entry->cpu, __entry->temp, __entry->min_power, + __entry->max_power) +); + +TRACE_EVENT(temp_threshold, + + TP_PROTO(unsigned int cpu, long temp, + long hi_thresh, long low_thresh), + + TP_ARGS(cpu, temp, hi_thresh, low_thresh), + + TP_STRUCT__entry( + __field(unsigned int, cpu) + __field(long, temp) + __field(long, hi_thresh) + __field(long, low_thresh) + ), + + TP_fast_assign( + __entry->cpu = cpu; + __entry->temp = temp; + __entry->hi_thresh = hi_thresh; + __entry->low_thresh = low_thresh; + ), + + TP_printk("Cpu%d: temp:%ld hi_thresh:%ld low_thresh:%ld", + __entry->cpu, __entry->temp, __entry->hi_thresh, + __entry->low_thresh) +); + +TRACE_EVENT(temp_notification, + + TP_PROTO(unsigned int sensor_id, enum thermal_trip_type type, + int temp, int prev_temp), + + TP_ARGS(sensor_id, type, temp, prev_temp), + + TP_STRUCT__entry( + __field(unsigned int, sensor_id) + __field(enum thermal_trip_type, type) + __field(int, temp) + __field(int, prev_temp) + ), + + TP_fast_assign( + __entry->sensor_id = sensor_id; + __entry->type = type; + __entry->temp = temp; + __entry->prev_temp = prev_temp; + ), + + TP_printk("Sensor_id%d: %s threshold triggered temp:%d(previous:%d)", + __entry->sensor_id, + __entry->type == THERMAL_TRIP_CONFIGURABLE_HI ? "High" : "Low", + __entry->temp, __entry->prev_temp) +); + +#endif +#define TRACE_INCLUDE_FILE trace_msm_core +#include <trace/define_trace.h> diff --git a/include/trace/events/trace_msm_low_power.h b/include/trace/events/trace_msm_low_power.h new file mode 100644 index 000000000000..97eefc665130 --- /dev/null +++ b/include/trace/events/trace_msm_low_power.h @@ -0,0 +1,273 @@ +/* Copyright (c) 2012, 2014-2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM msm_low_power + +#if !defined(_TRACE_MSM_LOW_POWER_H_) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_MSM_LOW_POWER_H_ + +#include <linux/tracepoint.h> + +TRACE_EVENT(cpu_power_select, + + TP_PROTO(int index, u32 sleep_us, u32 latency, u32 next_event_us), + + TP_ARGS(index, sleep_us, latency, next_event_us), + + TP_STRUCT__entry( + __field(int, index) + __field(u32, sleep_us) + __field(u32, latency) + __field(u32, next_event_us) + ), + + TP_fast_assign( + __entry->index = index; + __entry->sleep_us = sleep_us; + __entry->latency = latency; + __entry->next_event_us = next_event_us; + ), + + TP_printk("idx:%d sleep_time:%u latency:%u next_event:%u", + __entry->index, __entry->sleep_us, __entry->latency, + __entry->next_event_us) +); + +TRACE_EVENT(cpu_pred_select, + + TP_PROTO(u32 predtype, u64 predicted, u32 tmr_time), + + TP_ARGS(predtype, predicted, tmr_time), + + TP_STRUCT__entry( + __field(u32, predtype) + __field(u64, predicted) + __field(u32, tmr_time) + ), + + TP_fast_assign( + __entry->predtype = predtype; + __entry->predicted = predicted; + __entry->tmr_time = tmr_time; + ), + + TP_printk("pred:%u time:%lu tmr_time:%u", + __entry->predtype, (unsigned long)__entry->predicted, + __entry->tmr_time) +); + +TRACE_EVENT(cpu_pred_hist, + + TP_PROTO(int idx, u32 resi, u32 sample, u32 tmr), + + TP_ARGS(idx, resi, sample, tmr), + + TP_STRUCT__entry( + __field(int, idx) + __field(u32, resi) + __field(u32, sample) + __field(u32, tmr) + ), + + TP_fast_assign( + __entry->idx = idx; + __entry->resi = resi; + __entry->sample = sample; + __entry->tmr = tmr; + ), + + TP_printk("idx:%d resi:%u sample:%u tmr:%u", + __entry->idx, __entry->resi, + __entry->sample, __entry->tmr) +); + +TRACE_EVENT(cpu_idle_enter, + + TP_PROTO(int index), + + TP_ARGS(index), + + TP_STRUCT__entry( + __field(int, index) + ), + + TP_fast_assign( + __entry->index = index; + ), + + TP_printk("idx:%d", + __entry->index) +); + +TRACE_EVENT(cpu_idle_exit, + + TP_PROTO(int index, bool success), + + TP_ARGS(index, success), + + TP_STRUCT__entry( + __field(int, index) + __field(bool, success) + ), + + TP_fast_assign( + __entry->index = index; + __entry->success = success; + ), + + TP_printk("idx:%d success:%d", + __entry->index, + __entry->success) +); + +TRACE_EVENT(cluster_enter, + + TP_PROTO(const char *name, int index, unsigned long sync_cpus, + unsigned long child_cpus, bool from_idle), + + TP_ARGS(name, index, sync_cpus, child_cpus, from_idle), + + TP_STRUCT__entry( + __field(const char *, name) + __field(int, index) + __field(unsigned long, sync_cpus) + __field(unsigned long, child_cpus) + __field(bool, from_idle) + ), + + TP_fast_assign( + __entry->name = name; + __entry->index = index; + __entry->sync_cpus = sync_cpus; + __entry->child_cpus = child_cpus; + __entry->from_idle = from_idle; + ), + + TP_printk("cluster_name:%s idx:%d sync:0x%lx child:0x%lx idle:%d", + __entry->name, + __entry->index, + __entry->sync_cpus, + __entry->child_cpus, + __entry->from_idle) +); + +TRACE_EVENT(cluster_exit, + + TP_PROTO(const char *name, int index, unsigned long sync_cpus, + unsigned long child_cpus, bool from_idle), + + TP_ARGS(name, index, sync_cpus, child_cpus, from_idle), + + TP_STRUCT__entry( + __field(const char *, name) + __field(int, index) + __field(unsigned long, sync_cpus) + __field(unsigned long, child_cpus) + __field(bool, from_idle) + ), + + TP_fast_assign( + __entry->name = name; + __entry->index = index; + __entry->sync_cpus = sync_cpus; + __entry->child_cpus = child_cpus; + __entry->from_idle = from_idle; + ), + + TP_printk("cluster_name:%s idx:%d sync:0x%lx child:0x%lx idle:%d", + __entry->name, + __entry->index, + __entry->sync_cpus, + __entry->child_cpus, + __entry->from_idle) +); + +TRACE_EVENT(cluster_pred_select, + + TP_PROTO(const char *name, int index, u32 sleep_us, + u32 latency, int pred, u32 pred_us), + + TP_ARGS(name, index, sleep_us, latency, pred, pred_us), + + TP_STRUCT__entry( + __field(const char *, name) + __field(int, index) + __field(u32, sleep_us) + __field(u32, latency) + __field(int, pred) + __field(u32, pred_us) + ), + + TP_fast_assign( + __entry->name = name; + __entry->index = index; + __entry->sleep_us = sleep_us; + __entry->latency = latency; + __entry->pred = pred; + __entry->pred_us = pred_us; + ), + + TP_printk("name:%s idx:%d sleep_time:%u latency:%u pred:%d pred_us:%u", + __entry->name, __entry->index, __entry->sleep_us, + __entry->latency, __entry->pred, __entry->pred_us) +); + +TRACE_EVENT(cluster_pred_hist, + + TP_PROTO(const char *name, int idx, u32 resi, + u32 sample, u32 tmr), + + TP_ARGS(name, idx, resi, sample, tmr), + + TP_STRUCT__entry( + __field(const char *, name) + __field(int, idx) + __field(u32, resi) + __field(u32, sample) + __field(u32, tmr) + ), + + TP_fast_assign( + __entry->name = name; + __entry->idx = idx; + __entry->resi = resi; + __entry->sample = sample; + __entry->tmr = tmr; + ), + + TP_printk("name:%s idx:%d resi:%u sample:%u tmr:%u", + __entry->name, __entry->idx, __entry->resi, + __entry->sample, __entry->tmr) +); + +TRACE_EVENT(pre_pc_cb, + + TP_PROTO(int tzflag), + + TP_ARGS(tzflag), + + TP_STRUCT__entry( + __field(int, tzflag) + ), + + TP_fast_assign( + __entry->tzflag = tzflag; + ), + + TP_printk("tzflag:%d", + __entry->tzflag + ) +); +#endif +#define TRACE_INCLUDE_FILE trace_msm_low_power +#include <trace/define_trace.h> diff --git a/include/trace/events/trace_msm_pil_event.h b/include/trace/events/trace_msm_pil_event.h new file mode 100644 index 000000000000..4795dc5e0b2e --- /dev/null +++ b/include/trace/events/trace_msm_pil_event.h @@ -0,0 +1,88 @@ +/* Copyright (c) 2017, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM msm_pil_event + +#if !defined(_TRACE_MSM_PIL_EVENT_H_) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_MSM_PIL_EVENT_H_ + +#include <linux/tracepoint.h> +#include <../drivers/soc/qcom/peripheral-loader.h> + +TRACE_EVENT(pil_event, + + TP_PROTO(const char *event_name, struct pil_desc *desc), + + TP_ARGS(event_name, desc), + + TP_STRUCT__entry( + __string(event_name, event_name) + __string(fw_name, desc->fw_name) + ), + + TP_fast_assign( + __assign_str(event_name, event_name); + __assign_str(fw_name, desc->fw_name); + ), + + TP_printk("event_name=%s fw_name=%s", + __get_str(event_name), + __get_str(fw_name)) +); + +TRACE_EVENT(pil_notif, + + TP_PROTO(const char *event_name, unsigned long code, + const char *fw_name), + + TP_ARGS(event_name, code, fw_name), + + TP_STRUCT__entry( + __string(event_name, event_name) + __field(unsigned long, code) + __string(fw_name, fw_name) + ), + + TP_fast_assign( + __assign_str(event_name, event_name); + __entry->code = code; + __assign_str(fw_name, fw_name); + ), + + TP_printk("event_name=%s code=%lu fw=%s", + __get_str(event_name), + __entry->code, + __get_str(fw_name)) +); + +TRACE_EVENT(pil_func, + + TP_PROTO(const char *func_name), + + TP_ARGS(func_name), + + TP_STRUCT__entry( + __string(func_name, func_name) + ), + + TP_fast_assign( + __assign_str(func_name, func_name); + ), + + TP_printk("func_name=%s", + __get_str(func_name)) +); + +#endif +#define TRACE_INCLUDE_FILE trace_msm_pil_event +#include <trace/define_trace.h> diff --git a/include/trace/events/trace_rpm_smd.h b/include/trace/events/trace_rpm_smd.h new file mode 100644 index 000000000000..c43f03058e5b --- /dev/null +++ b/include/trace/events/trace_rpm_smd.h @@ -0,0 +1,111 @@ +/* Copyright (c) 2012, 2014-2015, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM rpm_smd + +#if !defined(_TRACE_RPM_SMD_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_RPM_SMD_H + +#include <linux/tracepoint.h> + +TRACE_EVENT(rpm_smd_ack_recvd, + + TP_PROTO(unsigned int irq, unsigned int msg_id, int errno), + + TP_ARGS(irq, msg_id, errno), + + TP_STRUCT__entry( + __field(int, irq) + __field(int, msg_id) + __field(int, errno) + ), + + TP_fast_assign( + __entry->irq = irq; + __entry->msg_id = msg_id; + __entry->errno = errno; + ), + + TP_printk("ctx:%s msg_id:%d errno:%08x", + __entry->irq ? "noslp" : "sleep", + __entry->msg_id, + __entry->errno) +); + +TRACE_EVENT(rpm_smd_interrupt_notify, + + TP_PROTO(char *dummy), + + TP_ARGS(dummy), + + TP_STRUCT__entry( + __field(char *, dummy) + ), + + TP_fast_assign( + __entry->dummy = dummy; + ), + + TP_printk("%s", __entry->dummy) +); + +DECLARE_EVENT_CLASS(rpm_send_msg, + + TP_PROTO(unsigned int msg_id, unsigned int rsc_type, + unsigned int rsc_id), + + TP_ARGS(msg_id, rsc_type, rsc_id), + + TP_STRUCT__entry( + __field(u32, msg_id) + __field(u32, rsc_type) + __field(u32, rsc_id) + __array(char, name, 5) + ), + + TP_fast_assign( + __entry->msg_id = msg_id; + __entry->name[4] = 0; + __entry->rsc_type = rsc_type; + __entry->rsc_id = rsc_id; + memcpy(__entry->name, &rsc_type, sizeof(uint32_t)); + + ), + + TP_printk("msg_id:%d, rsc_type:0x%08x(%s), rsc_id:0x%08x", + __entry->msg_id, + __entry->rsc_type, __entry->name, + __entry->rsc_id) +); + +DEFINE_EVENT(rpm_send_msg, rpm_smd_sleep_set, + TP_PROTO(unsigned int msg_id, unsigned int rsc_type, + unsigned int rsc_id), + TP_ARGS(msg_id, rsc_type, rsc_id) +); + +DEFINE_EVENT(rpm_send_msg, rpm_smd_send_sleep_set, + TP_PROTO(unsigned int msg_id, unsigned int rsc_type, + unsigned int rsc_id), + TP_ARGS(msg_id, rsc_type, rsc_id) +); + +DEFINE_EVENT(rpm_send_msg, rpm_smd_send_active_set, + TP_PROTO(unsigned int msg_id, unsigned int rsc_type, + unsigned int rsc_id), + TP_ARGS(msg_id, rsc_type, rsc_id) +); + +#endif +#define TRACE_INCLUDE_FILE trace_rpm_smd +#include <trace/define_trace.h> diff --git a/include/trace/events/ufs.h b/include/trace/events/ufs.h new file mode 100644 index 000000000000..6dc4735e919e --- /dev/null +++ b/include/trace/events/ufs.h @@ -0,0 +1,238 @@ +/* + * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM ufs + +#if !defined(_TRACE_UFS_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_UFS_H + +#include <linux/tracepoint.h> + +DECLARE_EVENT_CLASS(ufshcd_state_change_template, + TP_PROTO(const char *dev_name, int state), + + TP_ARGS(dev_name, state), + + TP_STRUCT__entry( + __string(dev_name, dev_name) + __field(int, state) + ), + + TP_fast_assign( + __assign_str(dev_name, dev_name); + __entry->state = state; + ), + + TP_printk("%s: state changed to %s", + __get_str(dev_name), __entry->state ? "ON" : "OFF") +); + +DEFINE_EVENT_PRINT(ufshcd_state_change_template, ufshcd_clk_gating, + TP_PROTO(const char *dev_name, int state), + TP_ARGS(dev_name, state), + TP_printk("%s: state changed to %s", __get_str(dev_name), + __print_symbolic(__entry->state, + { CLKS_OFF, "CLKS_OFF" }, + { CLKS_ON, "CLKS_ON" }, + { REQ_CLKS_OFF, "REQ_CLKS_OFF" }, + { REQ_CLKS_ON, "REQ_CLKS_ON" })) +); + +DEFINE_EVENT_PRINT(ufshcd_state_change_template, ufshcd_hibern8_on_idle, + TP_PROTO(const char *dev_name, int state), + TP_ARGS(dev_name, state), + TP_printk("%s: state changed to %s", __get_str(dev_name), + __print_symbolic(__entry->state, + { HIBERN8_ENTERED, "HIBERN8_ENTER" }, + { HIBERN8_EXITED, "HIBERN8_EXIT" }, + { REQ_HIBERN8_ENTER, "REQ_HIBERN8_ENTER" }, + { REQ_HIBERN8_EXIT, "REQ_HIBERN8_EXIT" })) +); + +DEFINE_EVENT(ufshcd_state_change_template, ufshcd_auto_bkops_state, + TP_PROTO(const char *dev_name, int state), + TP_ARGS(dev_name, state)); + +TRACE_EVENT(ufshcd_clk_scaling, + + TP_PROTO(const char *dev_name, const char *state, const char *clk, + u32 prev_state, u32 curr_state), + + TP_ARGS(dev_name, state, clk, prev_state, curr_state), + + TP_STRUCT__entry( + __string(dev_name, dev_name) + __string(state, state) + __string(clk, clk) + __field(u32, prev_state) + __field(u32, curr_state) + ), + + TP_fast_assign( + __assign_str(dev_name, dev_name); + __assign_str(state, state); + __assign_str(clk, clk); + __entry->prev_state = prev_state; + __entry->curr_state = curr_state; + ), + + TP_printk("%s: %s %s from %u to %u Hz", + __get_str(dev_name), __get_str(state), __get_str(clk), + __entry->prev_state, __entry->curr_state) +); + +DECLARE_EVENT_CLASS(ufshcd_profiling_template, + TP_PROTO(const char *dev_name, const char *profile_info, s64 time_us, + int err), + + TP_ARGS(dev_name, profile_info, time_us, err), + + TP_STRUCT__entry( + __string(dev_name, dev_name) + __string(profile_info, profile_info) + __field(s64, time_us) + __field(int, err) + ), + + TP_fast_assign( + __assign_str(dev_name, dev_name); + __assign_str(profile_info, profile_info); + __entry->time_us = time_us; + __entry->err = err; + ), + + TP_printk("%s: %s: took %lld usecs, err %d", + __get_str(dev_name), __get_str(profile_info), + __entry->time_us, __entry->err) +); + +DEFINE_EVENT(ufshcd_profiling_template, ufshcd_profile_hibern8, + TP_PROTO(const char *dev_name, const char *profile_info, s64 time_us, + int err), + TP_ARGS(dev_name, profile_info, time_us, err)); + +DEFINE_EVENT(ufshcd_profiling_template, ufshcd_profile_clk_gating, + TP_PROTO(const char *dev_name, const char *profile_info, s64 time_us, + int err), + TP_ARGS(dev_name, profile_info, time_us, err)); + +DEFINE_EVENT(ufshcd_profiling_template, ufshcd_profile_clk_scaling, + TP_PROTO(const char *dev_name, const char *profile_info, s64 time_us, + int err), + TP_ARGS(dev_name, profile_info, time_us, err)); + +DECLARE_EVENT_CLASS(ufshcd_template, + TP_PROTO(const char *dev_name, int err, s64 usecs, + int dev_state, int link_state), + + TP_ARGS(dev_name, err, usecs, dev_state, link_state), + + TP_STRUCT__entry( + __field(s64, usecs) + __field(int, err) + __string(dev_name, dev_name) + __field(int, dev_state) + __field(int, link_state) + ), + + TP_fast_assign( + __entry->usecs = usecs; + __entry->err = err; + __assign_str(dev_name, dev_name); + __entry->dev_state = dev_state; + __entry->link_state = link_state; + ), + + TP_printk( + "%s: took %lld usecs, dev_state: %s, link_state: %s, err %d", + __get_str(dev_name), + __entry->usecs, + __print_symbolic(__entry->dev_state, + { UFS_ACTIVE_PWR_MODE, "ACTIVE" }, + { UFS_SLEEP_PWR_MODE, "SLEEP" }, + { UFS_POWERDOWN_PWR_MODE, "POWERDOWN" }), + __print_symbolic(__entry->link_state, + { UIC_LINK_OFF_STATE, "LINK_OFF" }, + { UIC_LINK_ACTIVE_STATE, "LINK_ACTIVE" }, + { UIC_LINK_HIBERN8_STATE, "LINK_HIBERN8" }), + __entry->err + ) +); + +DEFINE_EVENT(ufshcd_template, ufshcd_system_suspend, + TP_PROTO(const char *dev_name, int err, s64 usecs, + int dev_state, int link_state), + TP_ARGS(dev_name, err, usecs, dev_state, link_state)); + +DEFINE_EVENT(ufshcd_template, ufshcd_system_resume, + TP_PROTO(const char *dev_name, int err, s64 usecs, + int dev_state, int link_state), + TP_ARGS(dev_name, err, usecs, dev_state, link_state)); + +DEFINE_EVENT(ufshcd_template, ufshcd_runtime_suspend, + TP_PROTO(const char *dev_name, int err, s64 usecs, + int dev_state, int link_state), + TP_ARGS(dev_name, err, usecs, dev_state, link_state)); + +DEFINE_EVENT(ufshcd_template, ufshcd_runtime_resume, + TP_PROTO(const char *dev_name, int err, s64 usecs, + int dev_state, int link_state), + TP_ARGS(dev_name, err, usecs, dev_state, link_state)); + +DEFINE_EVENT(ufshcd_template, ufshcd_init, + TP_PROTO(const char *dev_name, int err, s64 usecs, + int dev_state, int link_state), + TP_ARGS(dev_name, err, usecs, dev_state, link_state)); + +TRACE_EVENT(ufshcd_command, + TP_PROTO(const char *dev_name, const char *str, unsigned int tag, + u32 doorbell, int transfer_len, u32 intr, u64 lba, + u8 opcode), + + TP_ARGS(dev_name, str, tag, doorbell, transfer_len, intr, lba, opcode), + + TP_STRUCT__entry( + __string(dev_name, dev_name) + __string(str, str) + __field(unsigned int, tag) + __field(u32, doorbell) + __field(int, transfer_len) + __field(u32, intr) + __field(u64, lba) + __field(u8, opcode) + ), + + TP_fast_assign( + __assign_str(dev_name, dev_name); + __assign_str(str, str); + __entry->tag = tag; + __entry->doorbell = doorbell; + __entry->transfer_len = transfer_len; + __entry->intr = intr; + __entry->lba = lba; + __entry->opcode = opcode; + ), + + TP_printk( + "%s: %s: tag: %u, DB: 0x%x, size: %d, IS: %u, LBA: %llu, opcode: 0x%x", + __get_str(str), __get_str(dev_name), __entry->tag, + __entry->doorbell, __entry->transfer_len, + __entry->intr, __entry->lba, (u32)__entry->opcode + ) +); + +#endif /* if !defined(_TRACE_UFS_H) || defined(TRACE_HEADER_MULTI_READ) */ + +/* This part must be outside protection */ +#include <trace/define_trace.h> diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h index de996cf61053..af0cb7907922 100644 --- a/include/trace/trace_events.h +++ b/include/trace/trace_events.h @@ -682,7 +682,8 @@ trace_event_raw_event_##call(void *__data, proto) \ \ { assign; } \ \ - trace_event_buffer_commit(&fbuffer); \ + trace_event_buffer_commit(&fbuffer, \ + sizeof(*entry) + __data_size); \ } /* * The ftrace_test_probe is compiled out, it is only here as a build time check diff --git a/include/trace/trace_thermal.h b/include/trace/trace_thermal.h new file mode 100644 index 000000000000..39f3e9d08d13 --- /dev/null +++ b/include/trace/trace_thermal.h @@ -0,0 +1,430 @@ +/* + * Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM thermal + +#if !defined(_TRACE_THERMAL_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_THERMAL_H + +#include <linux/tracepoint.h> + +#ifdef TRACE_MSM_LMH +DECLARE_EVENT_CLASS(msm_lmh_print_sensor_reading, + + TP_PROTO(const char *sensor_name, unsigned int intensity), + + TP_ARGS( + sensor_name, intensity + ), + + TP_STRUCT__entry( + __string(_name, sensor_name) + __field(unsigned int, reading) + ), + + TP_fast_assign( + __assign_str(_name, sensor_name); + __entry->reading = intensity; + ), + + TP_printk( + "Sensor:[%s] throttling intensity:%u", __get_str(_name), + __entry->reading + ) +); + +DECLARE_EVENT_CLASS(msm_lmh_print_event, + + TP_PROTO(const char *event_name), + + TP_ARGS( + event_name + ), + + TP_STRUCT__entry( + __string(_name, event_name) + ), + + TP_fast_assign( + __assign_str(_name, event_name); + ), + + TP_printk( + "Event:[%s]", __get_str(_name) + ) +); + +DEFINE_EVENT(msm_lmh_print_sensor_reading, lmh_sensor_interrupt, + + TP_PROTO(const char *sensor_name, unsigned int intensity), + + TP_ARGS(sensor_name, intensity) +); + +DEFINE_EVENT(msm_lmh_print_sensor_reading, lmh_sensor_reading, + + TP_PROTO(const char *sensor_name, unsigned int intensity), + + TP_ARGS(sensor_name, intensity) +); + +DEFINE_EVENT(msm_lmh_print_event, lmh_event_call, + + TP_PROTO(const char *event_name), + + TP_ARGS(event_name) +); + +TRACE_EVENT(lmh_debug_data, + TP_PROTO(const char *pre_data, uint32_t *data_buf, uint32_t buffer_len), + + TP_ARGS( + pre_data, data_buf, buffer_len + ), + + TP_STRUCT__entry( + __string(_data, pre_data) + __field(u32, _buffer_len) + __dynamic_array(u32, _buffer, buffer_len) + ), + + TP_fast_assign( + __assign_str(_data, pre_data); + __entry->_buffer_len = buffer_len * sizeof(uint32_t); + memcpy(__get_dynamic_array(_buffer), data_buf, + buffer_len * sizeof(uint32_t)); + ), + + TP_printk("%s:\t %s", + __get_str(_data), __print_hex(__get_dynamic_array(_buffer), + __entry->_buffer_len) + ) +); + +#elif defined(LMH_DCVS_TRACE) +DECLARE_EVENT_CLASS(msm_lmh_dcvs_print, + + TP_PROTO(int cpu, long max_freq), + + TP_ARGS( + cpu, max_freq + ), + + TP_STRUCT__entry( + __field(int, cpu) + __field(long, max_freq) + ), + + TP_fast_assign( + __entry->cpu = cpu; + __entry->max_freq = max_freq; + ), + + TP_printk( + "cpu:%d max frequency:%ld", + __entry->cpu, __entry->max_freq + ) +); + +DEFINE_EVENT(msm_lmh_dcvs_print, lmh_dcvs_freq, + + TP_PROTO(int cpu, long max_freq), + + TP_ARGS(cpu, max_freq) +); + +#elif defined(TRACE_MSM_THERMAL) + +DECLARE_EVENT_CLASS(msm_thermal_post_core_ctl, + + TP_PROTO(unsigned int cpu, unsigned int online), + + TP_ARGS(cpu, online), + + TP_STRUCT__entry( + __field(unsigned int, cpu) + __field(unsigned int, online) + ), + + TP_fast_assign( + __entry->cpu = cpu; + __entry->online = online; + ), + + TP_printk("device=cpu%u online=%u", + __entry->cpu, __entry->online) +); +DECLARE_EVENT_CLASS(msm_thermal_pre_core_ctl, + + TP_PROTO(unsigned int cpu), + + TP_ARGS(cpu), + + TP_STRUCT__entry( + __field(unsigned int, cpu) + ), + + TP_fast_assign( + __entry->cpu = cpu; + ), + + TP_printk("device=cpu%u", __entry->cpu) +); + +DEFINE_EVENT(msm_thermal_pre_core_ctl, thermal_pre_core_offline, + + TP_PROTO(unsigned int cpu), + + TP_ARGS(cpu) +); + +DEFINE_EVENT(msm_thermal_post_core_ctl, thermal_post_core_offline, + + TP_PROTO(unsigned int cpu, unsigned int online), + + TP_ARGS(cpu, online) +); + +DEFINE_EVENT(msm_thermal_pre_core_ctl, thermal_pre_core_online, + + TP_PROTO(unsigned int cpu), + + TP_ARGS(cpu) +); + +DEFINE_EVENT(msm_thermal_post_core_ctl, thermal_post_core_online, + + TP_PROTO(unsigned int cpu, unsigned int online), + + TP_ARGS(cpu, online) +); + +DECLARE_EVENT_CLASS(msm_thermal_freq_mit, + + TP_PROTO(unsigned int cpu, unsigned int max_freq, + unsigned int min_freq), + + TP_ARGS(cpu, max_freq, min_freq), + + TP_STRUCT__entry( + __field(unsigned int, cpu) + __field(unsigned int, max_freq) + __field(unsigned int, min_freq) + ), + + TP_fast_assign( + __entry->cpu = cpu; + __entry->max_freq = max_freq; + __entry->min_freq = min_freq; + ), + + TP_printk("device=cpu%u max_frequency=%u min_frequency=%u", + __entry->cpu, __entry->max_freq, + __entry->min_freq) +); + +DEFINE_EVENT(msm_thermal_freq_mit, thermal_pre_frequency_mit, + + TP_PROTO(unsigned int cpu, unsigned int max_freq, + unsigned int min_freq), + + TP_ARGS(cpu, max_freq, min_freq) +); + +DEFINE_EVENT(msm_thermal_freq_mit, thermal_post_frequency_mit, + + TP_PROTO(unsigned int cpu, unsigned int max_freq, + unsigned int min_freq), + + TP_ARGS(cpu, max_freq, min_freq) +); + +#elif defined(_BCL_SW_TRACE) || defined(_BCL_HW_TRACE) + +DECLARE_EVENT_CLASS(msm_bcl_print_reading, + + TP_PROTO(const char *sensor_name, long value), + + TP_ARGS( + sensor_name, value + ), + + TP_STRUCT__entry( + __string(_name, sensor_name) + __field(long, reading) + ), + + TP_fast_assign( + __assign_str(_name, sensor_name); + __entry->reading = value; + ), + + TP_printk( + "%s:[%ld]", __get_str(_name), __entry->reading + ) +); + +DECLARE_EVENT_CLASS(msm_bcl_print_event, + + TP_PROTO(const char *event_name), + + TP_ARGS( + event_name + ), + + TP_STRUCT__entry( + __string(_name, event_name) + ), + + TP_fast_assign( + __assign_str(_name, event_name); + ), + + TP_printk( + "Event:[%s]", __get_str(_name) + ) +); + +#ifdef _BCL_HW_TRACE +DECLARE_EVENT_CLASS(msm_bcl_print_reg, + + TP_PROTO(const char *sensor_name, unsigned int address, + unsigned int value), + + TP_ARGS( + sensor_name, address, value + ), + + TP_STRUCT__entry( + __string(_name, sensor_name) + __field(unsigned int, _address) + __field(unsigned int, _value) + ), + + TP_fast_assign( + __assign_str(_name, sensor_name); + __entry->_address = address; + __entry->_value = value; + ), + + TP_printk( + "%s: address 0x%x: data 0x%02x", __get_str(_name), + __entry->_address, __entry->_value + ) +); + +DEFINE_EVENT(msm_bcl_print_reading, bcl_hw_sensor_reading, + + TP_PROTO(const char *sensor_name, long intensity), + + TP_ARGS(sensor_name, intensity) +); + +DEFINE_EVENT(msm_bcl_print_reg, bcl_hw_reg_access, + + TP_PROTO(const char *op_name, unsigned int address, unsigned int value), + + TP_ARGS(op_name, address, value) +); + +DEFINE_EVENT(msm_bcl_print_reading, bcl_hw_mitigation, + + TP_PROTO(const char *sensor_name, long intensity), + + TP_ARGS(sensor_name, intensity) +); + +DEFINE_EVENT(msm_bcl_print_event, bcl_hw_mitigation_event, + + TP_PROTO(const char *event_name), + + TP_ARGS(event_name) +); + +DEFINE_EVENT(msm_bcl_print_reading, bcl_hw_state_event, + + TP_PROTO(const char *sensor_name, long intensity), + + TP_ARGS(sensor_name, intensity) +); + +DEFINE_EVENT(msm_bcl_print_event, bcl_hw_event, + + TP_PROTO(const char *event_name), + + TP_ARGS(event_name) +); +#elif defined(_BCL_SW_TRACE) +DEFINE_EVENT(msm_bcl_print_reading, bcl_sw_mitigation, + + TP_PROTO(const char *sensor_name, long intensity), + + TP_ARGS(sensor_name, intensity) +); + +DEFINE_EVENT(msm_bcl_print_event, bcl_sw_mitigation_event, + + TP_PROTO(const char *event_name), + + TP_ARGS(event_name) +); +#endif /* _BCL_HW_TRACE */ +#else +DECLARE_EVENT_CLASS(tsens, + + TP_PROTO(unsigned long temp, unsigned int sensor), + + TP_ARGS(temp, sensor), + + TP_STRUCT__entry( + __field(unsigned long, temp) + __field(unsigned int, sensor) + ), + + TP_fast_assign( + __entry->temp = temp; + __entry->sensor = sensor; + ), + + TP_printk("temp=%lu sensor=tsens_tz_sensor%u", + __entry->temp, __entry->sensor) +); + +DEFINE_EVENT(tsens, tsens_read, + + TP_PROTO(unsigned long temp, unsigned int sensor), + + TP_ARGS(temp, sensor) +); + +DEFINE_EVENT(tsens, tsens_threshold_hit, + + TP_PROTO(unsigned long temp, unsigned int sensor), + + TP_ARGS(temp, sensor) +); + +DEFINE_EVENT(tsens, tsens_threshold_clear, + + TP_PROTO(unsigned long temp, unsigned int sensor), + + TP_ARGS(temp, sensor) +); +#endif +#endif +#undef TRACE_INCLUDE_PATH +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_PATH . +#define TRACE_INCLUDE_FILE trace_thermal +#include <trace/define_trace.h> |
