diff options
Diffstat (limited to 'include/trace')
76 files changed, 1530 insertions, 570 deletions
diff --git a/include/trace/bpf_probe.h b/include/trace/bpf_probe.h index e609cd7da4..a2ea11cc91 100644 --- a/include/trace/bpf_probe.h +++ b/include/trace/bpf_probe.h @@ -46,8 +46,7 @@ static notrace void \ __bpf_trace_##call(void *__data, proto) \ { \ - struct bpf_prog *prog = __data; \ - CONCATENATE(bpf_trace_run, COUNT_ARGS(args))(prog, CAST_TO_U64(args)); \ + CONCATENATE(bpf_trace_run, COUNT_ARGS(args))(__data, CAST_TO_U64(args)); \ } #undef DECLARE_EVENT_CLASS diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h index 517015ef36..202fc3680c 100644 --- a/include/trace/events/asoc.h +++ b/include/trace/events/asoc.h @@ -32,8 +32,8 @@ DECLARE_EVENT_CLASS(snd_soc_dapm, ), TP_fast_assign( - __assign_str(card_name, dapm->card->name); - __assign_str(comp_name, dapm->component ? dapm->component->name : "(none)"); + __assign_str(card_name); + __assign_str(comp_name); __entry->val = val; ), @@ -69,7 +69,7 @@ DECLARE_EVENT_CLASS(snd_soc_dapm_basic, ), TP_fast_assign( - __assign_str(name, card->name); + __assign_str(name); __entry->event = event; ), @@ -104,7 +104,7 @@ DECLARE_EVENT_CLASS(snd_soc_dapm_widget, ), TP_fast_assign( - __assign_str(name, w->name); + __assign_str(name); __entry->val = val; ), @@ -150,7 +150,7 @@ TRACE_EVENT(snd_soc_dapm_walk_done, ), TP_fast_assign( - __assign_str(name, card->name); + __assign_str(name); __entry->power_checks = card->dapm_stats.power_checks; __entry->path_checks = card->dapm_stats.path_checks; __entry->neighbour_checks = card->dapm_stats.neighbour_checks; @@ -179,9 +179,9 @@ TRACE_EVENT(snd_soc_dapm_path, ), TP_fast_assign( - __assign_str(wname, widget->name); - __assign_str(pname, path->name ? path->name : DAPM_DIRECT); - __assign_str(pnname, path->node[dir]->name); + __assign_str(wname); + __assign_str(pname); + __assign_str(pnname); __entry->path_connect = path->connect; __entry->path_node = (long)path->node[dir]; __entry->path_dir = dir; @@ -226,7 +226,7 @@ TRACE_EVENT(snd_soc_jack_irq, ), TP_fast_assign( - __assign_str(name, name); + __assign_str(name); ), TP_printk("%s", __get_str(name)) @@ -245,7 +245,7 @@ TRACE_EVENT(snd_soc_jack_report, ), TP_fast_assign( - __assign_str(name, jack->jack->id); + __assign_str(name); __entry->mask = mask; __entry->val = val; ), @@ -266,7 +266,7 @@ TRACE_EVENT(snd_soc_jack_notify, ), TP_fast_assign( - __assign_str(name, jack->jack->id); + __assign_str(name); __entry->val = val; ), diff --git a/include/trace/events/avc.h b/include/trace/events/avc.h index b55fda2e07..fed0f141d5 100644 --- a/include/trace/events/avc.h +++ b/include/trace/events/avc.h @@ -36,9 +36,9 @@ TRACE_EVENT(selinux_audited, __entry->denied = sad->denied; __entry->audited = sad->audited; __entry->result = sad->result; - __assign_str(tcontext, tcontext); - __assign_str(scontext, scontext); - __assign_str(tclass, tclass); + __assign_str(tcontext); + __assign_str(scontext); + __assign_str(tclass); ), TP_printk("requested=0x%x denied=0x%x audited=0x%x result=%d scontext=%s tcontext=%s tclass=%s", diff --git a/include/trace/events/bpf_test_run.h b/include/trace/events/bpf_test_run.h index 265447e3f7..0c924d39b7 100644 --- a/include/trace/events/bpf_test_run.h +++ b/include/trace/events/bpf_test_run.h @@ -7,6 +7,23 @@ #include <linux/tracepoint.h> +TRACE_EVENT(bpf_trigger_tp, + + TP_PROTO(int nonce), + + TP_ARGS(nonce), + + TP_STRUCT__entry( + __field(int, nonce) + ), + + TP_fast_assign( + __entry->nonce = nonce; + ), + + TP_printk("nonce %d", __entry->nonce) +); + DECLARE_EVENT_CLASS(bpf_test_finish, TP_PROTO(int *err), diff --git a/include/trace/events/bridge.h b/include/trace/events/bridge.h index a6b3a4e409..3fe4725c83 100644 --- a/include/trace/events/bridge.h +++ b/include/trace/events/bridge.h @@ -25,7 +25,7 @@ TRACE_EVENT(br_fdb_add, ), TP_fast_assign( - __assign_str(dev, dev->name); + __assign_str(dev); memcpy(__entry->addr, addr, ETH_ALEN); __entry->vid = vid; __entry->nlh_flags = nlh_flags; @@ -54,8 +54,8 @@ TRACE_EVENT(br_fdb_external_learn_add, ), TP_fast_assign( - __assign_str(br_dev, br->dev->name); - __assign_str(dev, p ? p->dev->name : "null"); + __assign_str(br_dev); + __assign_str(dev); memcpy(__entry->addr, addr, ETH_ALEN); __entry->vid = vid; ), @@ -80,8 +80,8 @@ TRACE_EVENT(fdb_delete, ), TP_fast_assign( - __assign_str(br_dev, br->dev->name); - __assign_str(dev, f->dst ? f->dst->dev->name : "null"); + __assign_str(br_dev); + __assign_str(dev); memcpy(__entry->addr, f->key.addr.addr, ETH_ALEN); __entry->vid = f->key.vlan_id; ), @@ -108,8 +108,8 @@ TRACE_EVENT(br_fdb_update, ), TP_fast_assign( - __assign_str(br_dev, br->dev->name); - __assign_str(dev, source->dev->name); + __assign_str(br_dev); + __assign_str(dev); memcpy(__entry->addr, addr, ETH_ALEN); __entry->vid = vid; __entry->flags = flags; @@ -141,7 +141,7 @@ TRACE_EVENT(br_mdb_full, TP_fast_assign( struct in6_addr *in6; - __assign_str(dev, dev->name); + __assign_str(dev); __entry->vid = group->vid; if (!group->proto) { diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h index 90b0222390..c978fa2893 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h @@ -16,8 +16,6 @@ struct extent_map; struct btrfs_file_extent_item; struct btrfs_ordered_extent; struct btrfs_delayed_ref_node; -struct btrfs_delayed_tree_ref; -struct btrfs_delayed_data_ref; struct btrfs_delayed_ref_head; struct btrfs_block_group; struct btrfs_free_cluster; @@ -277,8 +275,7 @@ DEFINE_EVENT(btrfs__inode, btrfs_inode_evict, { EXTENT_FLAG_COMPRESS_LZO, "COMPRESS_LZO" },\ { EXTENT_FLAG_COMPRESS_ZSTD, "COMPRESS_ZSTD" },\ { EXTENT_FLAG_PREALLOC, "PREALLOC" },\ - { EXTENT_FLAG_LOGGING, "LOGGING" },\ - { EXTENT_FLAG_FILLING, "FILLING" }) + { EXTENT_FLAG_LOGGING, "LOGGING" }) TRACE_EVENT_CONDITION(btrfs_get_extent, @@ -869,11 +866,9 @@ TRACE_EVENT(btrfs_add_block_group, DECLARE_EVENT_CLASS(btrfs_delayed_tree_ref, TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_tree_ref *full_ref, - int action), + const struct btrfs_delayed_ref_node *ref), - TP_ARGS(fs_info, ref, full_ref, action), + TP_ARGS(fs_info, ref), TP_STRUCT__entry_btrfs( __field( u64, bytenr ) @@ -889,10 +884,10 @@ DECLARE_EVENT_CLASS(btrfs_delayed_tree_ref, TP_fast_assign_btrfs(fs_info, __entry->bytenr = ref->bytenr; __entry->num_bytes = ref->num_bytes; - __entry->action = action; - __entry->parent = full_ref->parent; - __entry->ref_root = full_ref->root; - __entry->level = full_ref->level; + __entry->action = ref->action; + __entry->parent = ref->parent; + __entry->ref_root = ref->ref_root; + __entry->level = ref->tree_ref.level; __entry->type = ref->type; __entry->seq = ref->seq; ), @@ -912,31 +907,25 @@ DECLARE_EVENT_CLASS(btrfs_delayed_tree_ref, DEFINE_EVENT(btrfs_delayed_tree_ref, add_delayed_tree_ref, TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_tree_ref *full_ref, - int action), + const struct btrfs_delayed_ref_node *ref), - TP_ARGS(fs_info, ref, full_ref, action) + TP_ARGS(fs_info, ref) ); DEFINE_EVENT(btrfs_delayed_tree_ref, run_delayed_tree_ref, TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_tree_ref *full_ref, - int action), + const struct btrfs_delayed_ref_node *ref), - TP_ARGS(fs_info, ref, full_ref, action) + TP_ARGS(fs_info, ref) ); DECLARE_EVENT_CLASS(btrfs_delayed_data_ref, TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_data_ref *full_ref, - int action), + const struct btrfs_delayed_ref_node *ref), - TP_ARGS(fs_info, ref, full_ref, action), + TP_ARGS(fs_info, ref), TP_STRUCT__entry_btrfs( __field( u64, bytenr ) @@ -953,11 +942,11 @@ DECLARE_EVENT_CLASS(btrfs_delayed_data_ref, TP_fast_assign_btrfs(fs_info, __entry->bytenr = ref->bytenr; __entry->num_bytes = ref->num_bytes; - __entry->action = action; - __entry->parent = full_ref->parent; - __entry->ref_root = full_ref->root; - __entry->owner = full_ref->objectid; - __entry->offset = full_ref->offset; + __entry->action = ref->action; + __entry->parent = ref->parent; + __entry->ref_root = ref->ref_root; + __entry->owner = ref->data_ref.objectid; + __entry->offset = ref->data_ref.offset; __entry->type = ref->type; __entry->seq = ref->seq; ), @@ -979,21 +968,17 @@ DECLARE_EVENT_CLASS(btrfs_delayed_data_ref, DEFINE_EVENT(btrfs_delayed_data_ref, add_delayed_data_ref, TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_data_ref *full_ref, - int action), + const struct btrfs_delayed_ref_node *ref), - TP_ARGS(fs_info, ref, full_ref, action) + TP_ARGS(fs_info, ref) ); DEFINE_EVENT(btrfs_delayed_data_ref, run_delayed_data_ref, TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_data_ref *full_ref, - int action), + const struct btrfs_delayed_ref_node *ref), - TP_ARGS(fs_info, ref, full_ref, action) + TP_ARGS(fs_info, ref) ); DECLARE_EVENT_CLASS(btrfs_delayed_ref_head, @@ -1155,7 +1140,7 @@ TRACE_EVENT(btrfs_space_reservation, ), TP_fast_assign_btrfs(fs_info, - __assign_str(type, type); + __assign_str(type); __entry->val = val; __entry->bytes = bytes; __entry->reserve = reserve; @@ -1184,7 +1169,7 @@ TRACE_EVENT(btrfs_trigger_flush, __entry->flags = flags; __entry->bytes = bytes; __entry->flush = flush; - __assign_str(reason, reason); + __assign_str(reason); ), TP_printk_btrfs("%s: flush=%d(%s) flags=%llu(%s) bytes=%llu", @@ -1637,7 +1622,7 @@ DECLARE_EVENT_CLASS(btrfs_workqueue, TP_fast_assign_btrfs(btrfs_workqueue_owner(wq), __entry->wq = wq; - __assign_str(name, name); + __assign_str(name); ), TP_printk_btrfs("name=%s wq=%p", __get_str(name), @@ -2552,6 +2537,107 @@ TRACE_EVENT(btrfs_get_raid_extent_offset, __entry->devid) ); +TRACE_EVENT(btrfs_extent_map_shrinker_count, + + TP_PROTO(const struct btrfs_fs_info *fs_info, long nr), + + TP_ARGS(fs_info, nr), + + TP_STRUCT__entry_btrfs( + __field( long, nr ) + ), + + TP_fast_assign_btrfs(fs_info, + __entry->nr = nr; + ), + + TP_printk_btrfs("nr=%ld", __entry->nr) +); + +TRACE_EVENT(btrfs_extent_map_shrinker_scan_enter, + + TP_PROTO(const struct btrfs_fs_info *fs_info, long nr_to_scan, long nr, + u64 last_root_id, u64 last_ino), + + TP_ARGS(fs_info, nr_to_scan, nr, last_root_id, last_ino), + + TP_STRUCT__entry_btrfs( + __field( long, nr_to_scan ) + __field( long, nr ) + __field( u64, last_root_id ) + __field( u64, last_ino ) + ), + + TP_fast_assign_btrfs(fs_info, + __entry->nr_to_scan = nr_to_scan; + __entry->nr = nr; + __entry->last_root_id = last_root_id; + __entry->last_ino = last_ino; + ), + + TP_printk_btrfs("nr_to_scan=%ld nr=%ld last_root=%llu(%s) last_ino=%llu", + __entry->nr_to_scan, __entry->nr, + show_root_type(__entry->last_root_id), __entry->last_ino) +); + +TRACE_EVENT(btrfs_extent_map_shrinker_scan_exit, + + TP_PROTO(const struct btrfs_fs_info *fs_info, long nr_dropped, long nr, + u64 last_root_id, u64 last_ino), + + TP_ARGS(fs_info, nr_dropped, nr, last_root_id, last_ino), + + TP_STRUCT__entry_btrfs( + __field( long, nr_dropped ) + __field( long, nr ) + __field( u64, last_root_id ) + __field( u64, last_ino ) + ), + + TP_fast_assign_btrfs(fs_info, + __entry->nr_dropped = nr_dropped; + __entry->nr = nr; + __entry->last_root_id = last_root_id; + __entry->last_ino = last_ino; + ), + + TP_printk_btrfs("nr_dropped=%ld nr=%ld last_root=%llu(%s) last_ino=%llu", + __entry->nr_dropped, __entry->nr, + show_root_type(__entry->last_root_id), __entry->last_ino) +); + +TRACE_EVENT(btrfs_extent_map_shrinker_remove_em, + + TP_PROTO(const struct btrfs_inode *inode, const struct extent_map *em), + + TP_ARGS(inode, em), + + TP_STRUCT__entry_btrfs( + __field( u64, ino ) + __field( u64, root_id ) + __field( u64, start ) + __field( u64, len ) + __field( u64, block_start ) + __field( u32, flags ) + ), + + TP_fast_assign_btrfs(inode->root->fs_info, + __entry->ino = btrfs_ino(inode); + __entry->root_id = inode->root->root_key.objectid; + __entry->start = em->start; + __entry->len = em->len; + __entry->block_start = em->block_start; + __entry->flags = em->flags; + ), + + TP_printk_btrfs( +"ino=%llu root=%llu(%s) start=%llu len=%llu block_start=%llu(%s) flags=%s", + __entry->ino, show_root_type(__entry->root_id), + __entry->start, __entry->len, + show_map_type(__entry->block_start), + show_map_flags(__entry->flags)) +); + #endif /* _TRACE_BTRFS_H */ /* This part must be outside protection */ diff --git a/include/trace/events/cgroup.h b/include/trace/events/cgroup.h index dd7d7c9efe..af2755bda6 100644 --- a/include/trace/events/cgroup.h +++ b/include/trace/events/cgroup.h @@ -23,7 +23,7 @@ DECLARE_EVENT_CLASS(cgroup_root, TP_fast_assign( __entry->root = root->hierarchy_id; __entry->ss_mask = root->subsys_mask; - __assign_str(name, root->name); + __assign_str(name); ), TP_printk("root=%d ss_mask=%#x name=%s", @@ -68,7 +68,7 @@ DECLARE_EVENT_CLASS(cgroup, __entry->root = cgrp->root->hierarchy_id; __entry->id = cgroup_id(cgrp); __entry->level = cgrp->level; - __assign_str(path, path); + __assign_str(path); ), TP_printk("root=%d id=%llu level=%d path=%s", @@ -137,9 +137,9 @@ DECLARE_EVENT_CLASS(cgroup_migrate, __entry->dst_root = dst_cgrp->root->hierarchy_id; __entry->dst_id = cgroup_id(dst_cgrp); __entry->dst_level = dst_cgrp->level; - __assign_str(dst_path, path); + __assign_str(dst_path); __entry->pid = task->pid; - __assign_str(comm, task->comm); + __assign_str(comm); ), TP_printk("dst_root=%d dst_id=%llu dst_level=%d dst_path=%s pid=%d comm=%s", @@ -181,7 +181,7 @@ DECLARE_EVENT_CLASS(cgroup_event, __entry->root = cgrp->root->hierarchy_id; __entry->id = cgroup_id(cgrp); __entry->level = cgrp->level; - __assign_str(path, path); + __assign_str(path); __entry->val = val; ), @@ -204,6 +204,98 @@ DEFINE_EVENT(cgroup_event, cgroup_notify_frozen, TP_ARGS(cgrp, path, val) ); +DECLARE_EVENT_CLASS(cgroup_rstat, + + TP_PROTO(struct cgroup *cgrp, int cpu, bool contended), + + TP_ARGS(cgrp, cpu, contended), + + TP_STRUCT__entry( + __field( int, root ) + __field( int, level ) + __field( u64, id ) + __field( int, cpu ) + __field( bool, contended ) + ), + + TP_fast_assign( + __entry->root = cgrp->root->hierarchy_id; + __entry->id = cgroup_id(cgrp); + __entry->level = cgrp->level; + __entry->cpu = cpu; + __entry->contended = contended; + ), + + TP_printk("root=%d id=%llu level=%d cpu=%d lock contended:%d", + __entry->root, __entry->id, __entry->level, + __entry->cpu, __entry->contended) +); + +/* Related to global: cgroup_rstat_lock */ +DEFINE_EVENT(cgroup_rstat, cgroup_rstat_lock_contended, + + TP_PROTO(struct cgroup *cgrp, int cpu, bool contended), + + TP_ARGS(cgrp, cpu, contended) +); + +DEFINE_EVENT(cgroup_rstat, cgroup_rstat_locked, + + TP_PROTO(struct cgroup *cgrp, int cpu, bool contended), + + TP_ARGS(cgrp, cpu, contended) +); + +DEFINE_EVENT(cgroup_rstat, cgroup_rstat_unlock, + + TP_PROTO(struct cgroup *cgrp, int cpu, bool contended), + + TP_ARGS(cgrp, cpu, contended) +); + +/* Related to per CPU: cgroup_rstat_cpu_lock */ +DEFINE_EVENT(cgroup_rstat, cgroup_rstat_cpu_lock_contended, + + TP_PROTO(struct cgroup *cgrp, int cpu, bool contended), + + TP_ARGS(cgrp, cpu, contended) +); + +DEFINE_EVENT(cgroup_rstat, cgroup_rstat_cpu_lock_contended_fastpath, + + TP_PROTO(struct cgroup *cgrp, int cpu, bool contended), + + TP_ARGS(cgrp, cpu, contended) +); + +DEFINE_EVENT(cgroup_rstat, cgroup_rstat_cpu_locked, + + TP_PROTO(struct cgroup *cgrp, int cpu, bool contended), + + TP_ARGS(cgrp, cpu, contended) +); + +DEFINE_EVENT(cgroup_rstat, cgroup_rstat_cpu_locked_fastpath, + + TP_PROTO(struct cgroup *cgrp, int cpu, bool contended), + + TP_ARGS(cgrp, cpu, contended) +); + +DEFINE_EVENT(cgroup_rstat, cgroup_rstat_cpu_unlock, + + TP_PROTO(struct cgroup *cgrp, int cpu, bool contended), + + TP_ARGS(cgrp, cpu, contended) +); + +DEFINE_EVENT(cgroup_rstat, cgroup_rstat_cpu_unlock_fastpath, + + TP_PROTO(struct cgroup *cgrp, int cpu, bool contended), + + TP_ARGS(cgrp, cpu, contended) +); + #endif /* _TRACE_CGROUP_H */ /* This part must be outside protection */ diff --git a/include/trace/events/clk.h b/include/trace/events/clk.h index daed3c7a48..759f7371a6 100644 --- a/include/trace/events/clk.h +++ b/include/trace/events/clk.h @@ -23,7 +23,7 @@ DECLARE_EVENT_CLASS(clk, ), TP_fast_assign( - __assign_str(name, core->name); + __assign_str(name); ), TP_printk("%s", __get_str(name)) @@ -97,7 +97,7 @@ DECLARE_EVENT_CLASS(clk_rate, ), TP_fast_assign( - __assign_str(name, core->name); + __assign_str(name); __entry->rate = rate; ), @@ -145,7 +145,7 @@ DECLARE_EVENT_CLASS(clk_rate_range, ), TP_fast_assign( - __assign_str(name, core->name); + __assign_str(name); __entry->min = min; __entry->max = max; ), @@ -174,8 +174,8 @@ DECLARE_EVENT_CLASS(clk_parent, ), TP_fast_assign( - __assign_str(name, core->name); - __assign_str(pname, parent ? parent->name : "none"); + __assign_str(name); + __assign_str(pname); ), TP_printk("%s %s", __get_str(name), __get_str(pname)) @@ -207,7 +207,7 @@ DECLARE_EVENT_CLASS(clk_phase, ), TP_fast_assign( - __assign_str(name, core->name); + __assign_str(name); __entry->phase = phase; ), @@ -241,7 +241,7 @@ DECLARE_EVENT_CLASS(clk_duty_cycle, ), TP_fast_assign( - __assign_str(name, core->name); + __assign_str(name); __entry->num = duty->num; __entry->den = duty->den; ), @@ -279,8 +279,8 @@ DECLARE_EVENT_CLASS(clk_rate_request, ), TP_fast_assign( - __assign_str(name, req->core ? req->core->name : "none"); - __assign_str(pname, req->best_parent_hw ? clk_hw_get_name(req->best_parent_hw) : "none"); + __assign_str(name); + __assign_str(pname); __entry->min = req->min_rate; __entry->max = req->max_rate; __entry->prate = req->best_parent_rate; diff --git a/include/trace/events/cma.h b/include/trace/events/cma.h index 25103e6773..383c09f583 100644 --- a/include/trace/events/cma.h +++ b/include/trace/events/cma.h @@ -23,7 +23,7 @@ TRACE_EVENT(cma_release, ), TP_fast_assign( - __assign_str(name, name); + __assign_str(name); __entry->pfn = pfn; __entry->page = page; __entry->count = count; @@ -49,7 +49,7 @@ TRACE_EVENT(cma_alloc_start, ), TP_fast_assign( - __assign_str(name, name); + __assign_str(name); __entry->count = count; __entry->align = align; ), @@ -77,7 +77,7 @@ TRACE_EVENT(cma_alloc_finish, ), TP_fast_assign( - __assign_str(name, name); + __assign_str(name); __entry->pfn = pfn; __entry->page = page; __entry->count = count; @@ -110,7 +110,7 @@ TRACE_EVENT(cma_alloc_busy_retry, ), TP_fast_assign( - __assign_str(name, name); + __assign_str(name); __entry->pfn = pfn; __entry->page = page; __entry->count = count; diff --git a/include/trace/events/devfreq.h b/include/trace/events/devfreq.h index 7627c620bb..6cbc4d59fd 100644 --- a/include/trace/events/devfreq.h +++ b/include/trace/events/devfreq.h @@ -23,7 +23,7 @@ TRACE_EVENT(devfreq_frequency, ), TP_fast_assign( - __assign_str(dev_name, dev_name(&devfreq->dev)); + __assign_str(dev_name); __entry->freq = freq; __entry->prev_freq = prev_freq; __entry->busy_time = devfreq->last_status.busy_time; @@ -54,7 +54,7 @@ TRACE_EVENT(devfreq_monitor, __entry->busy_time = devfreq->last_status.busy_time; __entry->total_time = devfreq->last_status.total_time; __entry->polling_ms = devfreq->profile->polling_ms; - __assign_str(dev_name, dev_name(&devfreq->dev)); + __assign_str(dev_name); ), TP_printk("dev_name=%-30s freq=%-12lu polling_ms=%-3u load=%-2lu", diff --git a/include/trace/events/devlink.h b/include/trace/events/devlink.h index 77ff7cfc60..f241e204fe 100644 --- a/include/trace/events/devlink.h +++ b/include/trace/events/devlink.h @@ -31,9 +31,9 @@ TRACE_EVENT(devlink_hwmsg, ), TP_fast_assign( - __assign_str(bus_name, devlink_to_dev(devlink)->bus->name); - __assign_str(dev_name, dev_name(devlink_to_dev(devlink))); - __assign_str(driver_name, devlink_to_dev(devlink)->driver->name); + __assign_str(bus_name); + __assign_str(dev_name); + __assign_str(driver_name); __entry->incoming = incoming; __entry->type = type; memcpy(__get_dynamic_array(buf), buf, len); @@ -63,11 +63,11 @@ TRACE_EVENT(devlink_hwerr, ), TP_fast_assign( - __assign_str(bus_name, devlink_to_dev(devlink)->bus->name); - __assign_str(dev_name, dev_name(devlink_to_dev(devlink))); - __assign_str(driver_name, devlink_to_dev(devlink)->driver->name); + __assign_str(bus_name); + __assign_str(dev_name); + __assign_str(driver_name); __entry->err = err; - __assign_str(msg, msg); + __assign_str(msg); ), TP_printk("bus_name=%s dev_name=%s driver_name=%s err=%d %s", @@ -93,11 +93,11 @@ TRACE_EVENT(devlink_health_report, ), TP_fast_assign( - __assign_str(bus_name, devlink_to_dev(devlink)->bus->name); - __assign_str(dev_name, dev_name(devlink_to_dev(devlink))); - __assign_str(driver_name, devlink_to_dev(devlink)->driver->name); - __assign_str(reporter_name, reporter_name); - __assign_str(msg, msg); + __assign_str(bus_name); + __assign_str(dev_name); + __assign_str(driver_name); + __assign_str(reporter_name); + __assign_str(msg); ), TP_printk("bus_name=%s dev_name=%s driver_name=%s reporter_name=%s: %s", @@ -125,10 +125,10 @@ TRACE_EVENT(devlink_health_recover_aborted, ), TP_fast_assign( - __assign_str(bus_name, devlink_to_dev(devlink)->bus->name); - __assign_str(dev_name, dev_name(devlink_to_dev(devlink))); - __assign_str(driver_name, devlink_to_dev(devlink)->driver->name); - __assign_str(reporter_name, reporter_name); + __assign_str(bus_name); + __assign_str(dev_name); + __assign_str(driver_name); + __assign_str(reporter_name); __entry->health_state = health_state; __entry->time_since_last_recover = time_since_last_recover; ), @@ -158,10 +158,10 @@ TRACE_EVENT(devlink_health_reporter_state_update, ), TP_fast_assign( - __assign_str(bus_name, devlink_to_dev(devlink)->bus->name); - __assign_str(dev_name, dev_name(devlink_to_dev(devlink))); - __assign_str(driver_name, devlink_to_dev(devlink)->driver->name); - __assign_str(reporter_name, reporter_name); + __assign_str(bus_name); + __assign_str(dev_name); + __assign_str(driver_name); + __assign_str(reporter_name); __entry->new_state = new_state; ), @@ -192,11 +192,11 @@ TRACE_EVENT(devlink_trap_report, TP_fast_assign( struct net_device *input_dev = metadata->input_dev; - __assign_str(bus_name, devlink_to_dev(devlink)->bus->name); - __assign_str(dev_name, dev_name(devlink_to_dev(devlink))); - __assign_str(driver_name, devlink_to_dev(devlink)->driver->name); - __assign_str(trap_name, metadata->trap_name); - __assign_str(trap_group_name, metadata->trap_group_name); + __assign_str(bus_name); + __assign_str(dev_name); + __assign_str(driver_name); + __assign_str(trap_name); + __assign_str(trap_group_name); strscpy(__entry->input_dev_name, input_dev ? input_dev->name : "NULL", IFNAMSIZ); ), diff --git a/include/trace/events/dlm.h b/include/trace/events/dlm.h index c1a146f9fc..af160082c9 100644 --- a/include/trace/events/dlm.h +++ b/include/trace/events/dlm.h @@ -189,29 +189,25 @@ TRACE_EVENT(dlm_lock_end, TRACE_EVENT(dlm_bast, - TP_PROTO(struct dlm_ls *ls, struct dlm_lkb *lkb, int mode), + TP_PROTO(__u32 ls_id, __u32 lkb_id, int mode, + const char *res_name, size_t res_length), - TP_ARGS(ls, lkb, mode), + TP_ARGS(ls_id, lkb_id, mode, res_name, res_length), TP_STRUCT__entry( __field(__u32, ls_id) __field(__u32, lkb_id) __field(int, mode) - __dynamic_array(unsigned char, res_name, - lkb->lkb_resource ? lkb->lkb_resource->res_length : 0) + __dynamic_array(unsigned char, res_name, res_length) ), TP_fast_assign( - struct dlm_rsb *r; - - __entry->ls_id = ls->ls_global_id; - __entry->lkb_id = lkb->lkb_id; + __entry->ls_id = ls_id; + __entry->lkb_id = lkb_id; __entry->mode = mode; - r = lkb->lkb_resource; - if (r) - memcpy(__get_dynamic_array(res_name), r->res_name, - __get_dynamic_array_len(res_name)); + memcpy(__get_dynamic_array(res_name), res_name, + __get_dynamic_array_len(res_name)); ), TP_printk("ls_id=%u lkb_id=%x mode=%s res_name=%s", @@ -224,31 +220,27 @@ TRACE_EVENT(dlm_bast, TRACE_EVENT(dlm_ast, - TP_PROTO(struct dlm_ls *ls, struct dlm_lkb *lkb), + TP_PROTO(__u32 ls_id, __u32 lkb_id, __u8 sb_flags, int sb_status, + const char *res_name, size_t res_length), - TP_ARGS(ls, lkb), + TP_ARGS(ls_id, lkb_id, sb_flags, sb_status, res_name, res_length), TP_STRUCT__entry( __field(__u32, ls_id) __field(__u32, lkb_id) - __field(u8, sb_flags) + __field(__u8, sb_flags) __field(int, sb_status) - __dynamic_array(unsigned char, res_name, - lkb->lkb_resource ? lkb->lkb_resource->res_length : 0) + __dynamic_array(unsigned char, res_name, res_length) ), TP_fast_assign( - struct dlm_rsb *r; - - __entry->ls_id = ls->ls_global_id; - __entry->lkb_id = lkb->lkb_id; - __entry->sb_flags = lkb->lkb_lksb->sb_flags; - __entry->sb_status = lkb->lkb_lksb->sb_status; + __entry->ls_id = ls_id; + __entry->lkb_id = lkb_id; + __entry->sb_flags = sb_flags; + __entry->sb_status = sb_status; - r = lkb->lkb_resource; - if (r) - memcpy(__get_dynamic_array(res_name), r->res_name, - __get_dynamic_array_len(res_name)); + memcpy(__get_dynamic_array(res_name), res_name, + __get_dynamic_array_len(res_name)); ), TP_printk("ls_id=%u lkb_id=%x sb_flags=%s sb_status=%d res_name=%s", diff --git a/include/trace/events/dma_fence.h b/include/trace/events/dma_fence.h index 3963e79ca7..a4de3df850 100644 --- a/include/trace/events/dma_fence.h +++ b/include/trace/events/dma_fence.h @@ -23,8 +23,8 @@ DECLARE_EVENT_CLASS(dma_fence, ), TP_fast_assign( - __assign_str(driver, fence->ops->get_driver_name(fence)); - __assign_str(timeline, fence->ops->get_timeline_name(fence)); + __assign_str(driver); + __assign_str(timeline); __entry->context = fence->context; __entry->seqno = fence->seqno; ), diff --git a/include/trace/events/erofs.h b/include/trace/events/erofs.h index e18684b02c..b9bbfd855f 100644 --- a/include/trace/events/erofs.h +++ b/include/trace/events/erofs.h @@ -47,7 +47,7 @@ TRACE_EVENT(erofs_lookup, TP_fast_assign( __entry->dev = dir->i_sb->s_dev; __entry->nid = EROFS_I(dir)->nid; - __assign_str(name, dentry->d_name.name); + __assign_str(name); __entry->flags = flags; ), diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index 7ed0fc430d..ed794b5fef 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h @@ -354,7 +354,7 @@ TRACE_EVENT(f2fs_unlink_enter, __entry->ino = dir->i_ino; __entry->size = dir->i_size; __entry->blocks = dir->i_blocks; - __assign_str(name, dentry->d_name.name); + __assign_str(name); ), TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, " @@ -843,7 +843,7 @@ TRACE_EVENT(f2fs_lookup_start, TP_fast_assign( __entry->dev = dir->i_sb->s_dev; __entry->ino = dir->i_ino; - __assign_str(name, dentry->d_name.name); + __assign_str(name); __entry->flags = flags; ), @@ -871,7 +871,7 @@ TRACE_EVENT(f2fs_lookup_end, TP_fast_assign( __entry->dev = dir->i_sb->s_dev; __entry->ino = dir->i_ino; - __assign_str(name, dentry->d_name.name); + __assign_str(name); __entry->cino = ino; __entry->err = err; ), @@ -903,9 +903,9 @@ TRACE_EVENT(f2fs_rename_start, TP_fast_assign( __entry->dev = old_dir->i_sb->s_dev; __entry->ino = old_dir->i_ino; - __assign_str(old_name, old_dentry->d_name.name); + __assign_str(old_name); __entry->new_pino = new_dir->i_ino; - __assign_str(new_name, new_dentry->d_name.name); + __assign_str(new_name); __entry->flags = flags; ), @@ -937,8 +937,8 @@ TRACE_EVENT(f2fs_rename_end, TP_fast_assign( __entry->dev = old_dentry->d_sb->s_dev; __entry->ino = old_dentry->d_inode->i_ino; - __assign_str(old_name, old_dentry->d_name.name); - __assign_str(new_name, new_dentry->d_name.name); + __assign_str(old_name); + __assign_str(new_name); __entry->flags = flags; __entry->ret = ret; ), @@ -1304,11 +1304,11 @@ TRACE_EVENT(f2fs_write_end, __entry->copied) ); -DECLARE_EVENT_CLASS(f2fs__page, +DECLARE_EVENT_CLASS(f2fs__folio, - TP_PROTO(struct page *page, int type), + TP_PROTO(struct folio *folio, int type), - TP_ARGS(page, type), + TP_ARGS(folio, type), TP_STRUCT__entry( __field(dev_t, dev) @@ -1321,14 +1321,14 @@ DECLARE_EVENT_CLASS(f2fs__page, ), TP_fast_assign( - __entry->dev = page_file_mapping(page)->host->i_sb->s_dev; - __entry->ino = page_file_mapping(page)->host->i_ino; + __entry->dev = folio_file_mapping(folio)->host->i_sb->s_dev; + __entry->ino = folio_file_mapping(folio)->host->i_ino; __entry->type = type; __entry->dir = - S_ISDIR(page_file_mapping(page)->host->i_mode); - __entry->index = page->index; - __entry->dirty = PageDirty(page); - __entry->uptodate = PageUptodate(page); + S_ISDIR(folio_file_mapping(folio)->host->i_mode); + __entry->index = folio_index(folio); + __entry->dirty = folio_test_dirty(folio); + __entry->uptodate = folio_test_uptodate(folio); ), TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, " @@ -1341,32 +1341,32 @@ DECLARE_EVENT_CLASS(f2fs__page, __entry->uptodate) ); -DEFINE_EVENT(f2fs__page, f2fs_writepage, +DEFINE_EVENT(f2fs__folio, f2fs_writepage, - TP_PROTO(struct page *page, int type), + TP_PROTO(struct folio *folio, int type), - TP_ARGS(page, type) + TP_ARGS(folio, type) ); -DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page, +DEFINE_EVENT(f2fs__folio, f2fs_do_write_data_page, - TP_PROTO(struct page *page, int type), + TP_PROTO(struct folio *folio, int type), - TP_ARGS(page, type) + TP_ARGS(folio, type) ); -DEFINE_EVENT(f2fs__page, f2fs_readpage, +DEFINE_EVENT(f2fs__folio, f2fs_readpage, - TP_PROTO(struct page *page, int type), + TP_PROTO(struct folio *folio, int type), - TP_ARGS(page, type) + TP_ARGS(folio, type) ); -DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty, +DEFINE_EVENT(f2fs__folio, f2fs_set_page_dirty, - TP_PROTO(struct page *page, int type), + TP_PROTO(struct folio *folio, int type), - TP_ARGS(page, type) + TP_ARGS(folio, type) ); TRACE_EVENT(f2fs_replace_atomic_write_block, @@ -1557,7 +1557,7 @@ TRACE_EVENT(f2fs_write_checkpoint, TP_fast_assign( __entry->dev = sb->s_dev; __entry->reason = reason; - __assign_str(dest_msg, msg); + __assign_str(dest_msg); ), TP_printk("dev = (%d,%d), checkpoint for %s, state = %s", @@ -2333,12 +2333,12 @@ DECLARE_EVENT_CLASS(f2fs__rw_start, * because this screws up the tooling that parses * the traces. */ - __assign_str(pathbuf, pathname); + __assign_str(pathbuf); (void)strreplace(__get_str(pathbuf), ' ', '_'); __entry->offset = offset; __entry->bytes = bytes; __entry->i_size = i_size_read(inode); - __assign_str(cmdline, command); + __assign_str(cmdline); (void)strreplace(__get_str(cmdline), ' ', '_'); __entry->pid = pid; __entry->ino = inode->i_ino; diff --git a/include/trace/events/firewire.h b/include/trace/events/firewire.h new file mode 100644 index 0000000000..5ccc0d91b2 --- /dev/null +++ b/include/trace/events/firewire.h @@ -0,0 +1,373 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// Copyright (c) 2024 Takashi Sakamoto + +#define TRACE_SYSTEM firewire + +#if !defined(_FIREWIRE_TRACE_EVENT_H) || defined(TRACE_HEADER_MULTI_READ) +#define _FIREWIRE_TRACE_EVENT_H + +#include <linux/tracepoint.h> +#include <linux/firewire.h> + +#include <linux/firewire-constants.h> + +#include "../../../drivers/firewire/packet-header-definitions.h" + +// The content of TP_printk field is preprocessed, then put to the module binary. +#define ASYNC_HEADER_GET_DESTINATION(header) \ + (((header)[0] & ASYNC_HEADER_Q0_DESTINATION_MASK) >> ASYNC_HEADER_Q0_DESTINATION_SHIFT) + +#define ASYNC_HEADER_GET_TLABEL(header) \ + (((header)[0] & ASYNC_HEADER_Q0_TLABEL_MASK) >> ASYNC_HEADER_Q0_TLABEL_SHIFT) + +#define ASYNC_HEADER_GET_TCODE(header) \ + (((header)[0] & ASYNC_HEADER_Q0_TCODE_MASK) >> ASYNC_HEADER_Q0_TCODE_SHIFT) + +#define ASYNC_HEADER_GET_SOURCE(header) \ + (((header)[1] & ASYNC_HEADER_Q1_SOURCE_MASK) >> ASYNC_HEADER_Q1_SOURCE_SHIFT) + +#define ASYNC_HEADER_GET_OFFSET(header) \ + ((((unsigned long long)((header)[1] & ASYNC_HEADER_Q1_OFFSET_HIGH_MASK)) >> ASYNC_HEADER_Q1_OFFSET_HIGH_SHIFT) << 32)| \ + (header)[2] + +#define ASYNC_HEADER_GET_RCODE(header) \ + (((header)[1] & ASYNC_HEADER_Q1_RCODE_MASK) >> ASYNC_HEADER_Q1_RCODE_SHIFT) + +#define QUADLET_SIZE 4 + +DECLARE_EVENT_CLASS(async_outbound_initiate_template, + TP_PROTO(u64 transaction, unsigned int card_index, unsigned int generation, unsigned int scode, const u32 *header, const u32 *data, unsigned int data_count), + TP_ARGS(transaction, card_index, generation, scode, header, data, data_count), + TP_STRUCT__entry( + __field(u64, transaction) + __field(u8, card_index) + __field(u8, generation) + __field(u8, scode) + __array(u32, header, ASYNC_HEADER_QUADLET_COUNT) + __dynamic_array(u32, data, data_count) + ), + TP_fast_assign( + __entry->transaction = transaction; + __entry->card_index = card_index; + __entry->generation = generation; + __entry->scode = scode; + memcpy(__entry->header, header, QUADLET_SIZE * ASYNC_HEADER_QUADLET_COUNT); + memcpy(__get_dynamic_array(data), data, __get_dynamic_array_len(data)); + ), + // This format is for the request subaction. + TP_printk( + "transaction=0x%llx card_index=%u generation=%u scode=%u dst_id=0x%04x tlabel=%u tcode=%u src_id=0x%04x offset=0x%012llx header=%s data=%s", + __entry->transaction, + __entry->card_index, + __entry->generation, + __entry->scode, + ASYNC_HEADER_GET_DESTINATION(__entry->header), + ASYNC_HEADER_GET_TLABEL(__entry->header), + ASYNC_HEADER_GET_TCODE(__entry->header), + ASYNC_HEADER_GET_SOURCE(__entry->header), + ASYNC_HEADER_GET_OFFSET(__entry->header), + __print_array(__entry->header, ASYNC_HEADER_QUADLET_COUNT, QUADLET_SIZE), + __print_array(__get_dynamic_array(data), + __get_dynamic_array_len(data) / QUADLET_SIZE, QUADLET_SIZE) + ) +); + +// The value of status is one of ack codes and rcodes specific to Linux FireWire subsystem. +DECLARE_EVENT_CLASS(async_outbound_complete_template, + TP_PROTO(u64 transaction, unsigned int card_index, unsigned int generation, unsigned int scode, unsigned int status, unsigned int timestamp), + TP_ARGS(transaction, card_index, generation, scode, status, timestamp), + TP_STRUCT__entry( + __field(u64, transaction) + __field(u8, card_index) + __field(u8, generation) + __field(u8, scode) + __field(u8, status) + __field(u16, timestamp) + ), + TP_fast_assign( + __entry->transaction = transaction; + __entry->card_index = card_index; + __entry->generation = generation; + __entry->scode = scode; + __entry->status = status; + __entry->timestamp = timestamp; + ), + TP_printk( + "transaction=0x%llx card_index=%u generation=%u scode=%u status=%u timestamp=0x%04x", + __entry->transaction, + __entry->card_index, + __entry->generation, + __entry->scode, + __entry->status, + __entry->timestamp + ) +); + +// The value of status is one of ack codes and rcodes specific to Linux FireWire subsystem. +DECLARE_EVENT_CLASS(async_inbound_template, + TP_PROTO(u64 transaction, unsigned int card_index, unsigned int generation, unsigned int scode, unsigned int status, unsigned int timestamp, const u32 *header, const u32 *data, unsigned int data_count), + TP_ARGS(transaction, card_index, generation, scode, status, timestamp, header, data, data_count), + TP_STRUCT__entry( + __field(u64, transaction) + __field(u8, card_index) + __field(u8, generation) + __field(u8, scode) + __field(u8, status) + __field(u16, timestamp) + __array(u32, header, ASYNC_HEADER_QUADLET_COUNT) + __dynamic_array(u32, data, data_count) + ), + TP_fast_assign( + __entry->transaction = transaction; + __entry->card_index = card_index; + __entry->generation = generation; + __entry->scode = scode; + __entry->status = status; + __entry->timestamp = timestamp; + memcpy(__entry->header, header, QUADLET_SIZE * ASYNC_HEADER_QUADLET_COUNT); + memcpy(__get_dynamic_array(data), data, __get_dynamic_array_len(data)); + ), + // This format is for the response subaction. + TP_printk( + "transaction=0x%llx card_index=%u generation=%u scode=%u status=%u timestamp=0x%04x dst_id=0x%04x tlabel=%u tcode=%u src_id=0x%04x rcode=%u header=%s data=%s", + __entry->transaction, + __entry->card_index, + __entry->generation, + __entry->scode, + __entry->status, + __entry->timestamp, + ASYNC_HEADER_GET_DESTINATION(__entry->header), + ASYNC_HEADER_GET_TLABEL(__entry->header), + ASYNC_HEADER_GET_TCODE(__entry->header), + ASYNC_HEADER_GET_SOURCE(__entry->header), + ASYNC_HEADER_GET_RCODE(__entry->header), + __print_array(__entry->header, ASYNC_HEADER_QUADLET_COUNT, QUADLET_SIZE), + __print_array(__get_dynamic_array(data), + __get_dynamic_array_len(data) / QUADLET_SIZE, QUADLET_SIZE) + ) +); + +DEFINE_EVENT(async_outbound_initiate_template, async_request_outbound_initiate, + TP_PROTO(u64 transaction, unsigned int card_index, unsigned int generation, unsigned int scode, const u32 *header, const u32 *data, unsigned int data_count), + TP_ARGS(transaction, card_index, generation, scode, header, data, data_count) +); + +DEFINE_EVENT(async_outbound_complete_template, async_request_outbound_complete, + TP_PROTO(u64 transaction, unsigned int card_index, unsigned int generation, unsigned int scode, unsigned int status, unsigned int timestamp), + TP_ARGS(transaction, card_index, generation, scode, status, timestamp) +); + +DEFINE_EVENT(async_inbound_template, async_response_inbound, + TP_PROTO(u64 transaction, unsigned int card_index, unsigned int generation, unsigned int scode, unsigned int status, unsigned int timestamp, const u32 *header, const u32 *data, unsigned int data_count), + TP_ARGS(transaction, card_index, generation, scode, status, timestamp, header, data, data_count) +); + +DEFINE_EVENT_PRINT(async_inbound_template, async_request_inbound, + TP_PROTO(u64 transaction, unsigned int card_index, unsigned int generation, unsigned int scode, unsigned int status, unsigned int timestamp, const u32 *header, const u32 *data, unsigned int data_count), + TP_ARGS(transaction, card_index, generation, scode, status, timestamp, header, data, data_count), + TP_printk( + "transaction=0x%llx card_index=%u generation=%u scode=%u status=%u timestamp=0x%04x dst_id=0x%04x tlabel=%u tcode=%u src_id=0x%04x offset=0x%012llx header=%s data=%s", + __entry->transaction, + __entry->card_index, + __entry->generation, + __entry->scode, + __entry->status, + __entry->timestamp, + ASYNC_HEADER_GET_DESTINATION(__entry->header), + ASYNC_HEADER_GET_TLABEL(__entry->header), + ASYNC_HEADER_GET_TCODE(__entry->header), + ASYNC_HEADER_GET_SOURCE(__entry->header), + ASYNC_HEADER_GET_OFFSET(__entry->header), + __print_array(__entry->header, ASYNC_HEADER_QUADLET_COUNT, QUADLET_SIZE), + __print_array(__get_dynamic_array(data), + __get_dynamic_array_len(data) / QUADLET_SIZE, QUADLET_SIZE) + ) +); + +DEFINE_EVENT_PRINT(async_outbound_initiate_template, async_response_outbound_initiate, + TP_PROTO(u64 transaction, unsigned int card_index, unsigned int generation, unsigned int scode, const u32 *header, const u32 *data, unsigned int data_count), + TP_ARGS(transaction, card_index, generation, scode, header, data, data_count), + TP_printk( + "transaction=0x%llx card_index=%u generation=%u scode=%u dst_id=0x%04x tlabel=%u tcode=%u src_id=0x%04x rcode=%u header=%s data=%s", + __entry->transaction, + __entry->card_index, + __entry->generation, + __entry->scode, + ASYNC_HEADER_GET_DESTINATION(__entry->header), + ASYNC_HEADER_GET_TLABEL(__entry->header), + ASYNC_HEADER_GET_TCODE(__entry->header), + ASYNC_HEADER_GET_SOURCE(__entry->header), + ASYNC_HEADER_GET_RCODE(__entry->header), + __print_array(__entry->header, ASYNC_HEADER_QUADLET_COUNT, QUADLET_SIZE), + __print_array(__get_dynamic_array(data), + __get_dynamic_array_len(data) / QUADLET_SIZE, QUADLET_SIZE) + ) +); + +DEFINE_EVENT(async_outbound_complete_template, async_response_outbound_complete, + TP_PROTO(u64 transaction, unsigned int card_index, unsigned int generation, unsigned int scode, unsigned int status, unsigned int timestamp), + TP_ARGS(transaction, card_index, generation, scode, status, timestamp) +); + +#undef ASYNC_HEADER_GET_DESTINATION +#undef ASYNC_HEADER_GET_TLABEL +#undef ASYNC_HEADER_GET_TCODE +#undef ASYNC_HEADER_GET_SOURCE +#undef ASYNC_HEADER_GET_OFFSET +#undef ASYNC_HEADER_GET_RCODE + +TRACE_EVENT(async_phy_outbound_initiate, + TP_PROTO(u64 packet, unsigned int card_index, unsigned int generation, u32 first_quadlet, u32 second_quadlet), + TP_ARGS(packet, card_index, generation, first_quadlet, second_quadlet), + TP_STRUCT__entry( + __field(u64, packet) + __field(u8, card_index) + __field(u8, generation) + __field(u32, first_quadlet) + __field(u32, second_quadlet) + ), + TP_fast_assign( + __entry->packet = packet; + __entry->card_index = card_index; + __entry->generation = generation; + __entry->first_quadlet = first_quadlet; + __entry->second_quadlet = second_quadlet + ), + TP_printk( + "packet=0x%llx card_index=%u generation=%u first_quadlet=0x%08x second_quadlet=0x%08x", + __entry->packet, + __entry->card_index, + __entry->generation, + __entry->first_quadlet, + __entry->second_quadlet + ) +); + +TRACE_EVENT(async_phy_outbound_complete, + TP_PROTO(u64 packet, unsigned int card_index, unsigned int generation, unsigned int status, unsigned int timestamp), + TP_ARGS(packet, card_index, generation, status, timestamp), + TP_STRUCT__entry( + __field(u64, packet) + __field(u8, card_index) + __field(u8, generation) + __field(u8, status) + __field(u16, timestamp) + ), + TP_fast_assign( + __entry->packet = packet; + __entry->card_index = card_index; + __entry->generation = generation; + __entry->status = status; + __entry->timestamp = timestamp; + ), + TP_printk( + "packet=0x%llx card_index=%u generation=%u status=%u timestamp=0x%04x", + __entry->packet, + __entry->card_index, + __entry->generation, + __entry->status, + __entry->timestamp + ) +); + +TRACE_EVENT(async_phy_inbound, + TP_PROTO(u64 packet, unsigned int card_index, unsigned int generation, unsigned int status, unsigned int timestamp, u32 first_quadlet, u32 second_quadlet), + TP_ARGS(packet, card_index, generation, status, timestamp, first_quadlet, second_quadlet), + TP_STRUCT__entry( + __field(u64, packet) + __field(u8, card_index) + __field(u8, generation) + __field(u8, status) + __field(u16, timestamp) + __field(u32, first_quadlet) + __field(u32, second_quadlet) + ), + TP_fast_assign( + __entry->packet = packet; + __entry->generation = generation; + __entry->status = status; + __entry->timestamp = timestamp; + __entry->first_quadlet = first_quadlet; + __entry->second_quadlet = second_quadlet + ), + TP_printk( + "packet=0x%llx card_index=%u generation=%u status=%u timestamp=0x%04x first_quadlet=0x%08x second_quadlet=0x%08x", + __entry->packet, + __entry->card_index, + __entry->generation, + __entry->status, + __entry->timestamp, + __entry->first_quadlet, + __entry->second_quadlet + ) +); + +DECLARE_EVENT_CLASS(bus_reset_arrange_template, + TP_PROTO(unsigned int card_index, unsigned int generation, bool short_reset), + TP_ARGS(card_index, generation, short_reset), + TP_STRUCT__entry( + __field(u8, card_index) + __field(u8, generation) + __field(bool, short_reset) + ), + TP_fast_assign( + __entry->card_index = card_index; + __entry->generation = generation; + __entry->short_reset = short_reset; + ), + TP_printk( + "card_index=%u generation=%u short_reset=%s", + __entry->card_index, + __entry->generation, + __entry->short_reset ? "true" : "false" + ) +); + +DEFINE_EVENT(bus_reset_arrange_template, bus_reset_initiate, + TP_PROTO(unsigned int card_index, unsigned int generation, bool short_reset), + TP_ARGS(card_index, generation, short_reset) +); + +DEFINE_EVENT(bus_reset_arrange_template, bus_reset_schedule, + TP_PROTO(unsigned int card_index, unsigned int generation, bool short_reset), + TP_ARGS(card_index, generation, short_reset) +); + +DEFINE_EVENT(bus_reset_arrange_template, bus_reset_postpone, + TP_PROTO(unsigned int card_index, unsigned int generation, bool short_reset), + TP_ARGS(card_index, generation, short_reset) +); + +TRACE_EVENT(bus_reset_handle, + TP_PROTO(unsigned int card_index, unsigned int generation, unsigned int node_id, bool bm_abdicate, u32 *self_ids, unsigned int self_id_count), + TP_ARGS(card_index, generation, node_id, bm_abdicate, self_ids, self_id_count), + TP_STRUCT__entry( + __field(u8, card_index) + __field(u8, generation) + __field(u8, node_id) + __field(bool, bm_abdicate) + __dynamic_array(u32, self_ids, self_id_count) + ), + TP_fast_assign( + __entry->card_index = card_index; + __entry->generation = generation; + __entry->node_id = node_id; + __entry->bm_abdicate = bm_abdicate; + memcpy(__get_dynamic_array(self_ids), self_ids, __get_dynamic_array_len(self_ids)); + ), + TP_printk( + "card_index=%u generation=%u node_id=0x%04x bm_abdicate=%s self_ids=%s", + __entry->card_index, + __entry->generation, + __entry->node_id, + __entry->bm_abdicate ? "true" : "false", + __print_array(__get_dynamic_array(self_ids), + __get_dynamic_array_len(self_ids) / QUADLET_SIZE, QUADLET_SIZE) + ) +); + +#undef QUADLET_SIZE + +#endif // _FIREWIRE_TRACE_EVENT_H + +#include <trace/define_trace.h> diff --git a/include/trace/events/fs_dax.h b/include/trace/events/fs_dax.h index 97b09fcf7e..86fe6aecff 100644 --- a/include/trace/events/fs_dax.h +++ b/include/trace/events/fs_dax.h @@ -62,14 +62,14 @@ DEFINE_PMD_FAULT_EVENT(dax_pmd_fault_done); DECLARE_EVENT_CLASS(dax_pmd_load_hole_class, TP_PROTO(struct inode *inode, struct vm_fault *vmf, - struct page *zero_page, + struct folio *zero_folio, void *radix_entry), - TP_ARGS(inode, vmf, zero_page, radix_entry), + TP_ARGS(inode, vmf, zero_folio, radix_entry), TP_STRUCT__entry( __field(unsigned long, ino) __field(unsigned long, vm_flags) __field(unsigned long, address) - __field(struct page *, zero_page) + __field(struct folio *, zero_folio) __field(void *, radix_entry) __field(dev_t, dev) ), @@ -78,17 +78,17 @@ DECLARE_EVENT_CLASS(dax_pmd_load_hole_class, __entry->ino = inode->i_ino; __entry->vm_flags = vmf->vma->vm_flags; __entry->address = vmf->address; - __entry->zero_page = zero_page; + __entry->zero_folio = zero_folio; __entry->radix_entry = radix_entry; ), - TP_printk("dev %d:%d ino %#lx %s address %#lx zero_page %p " + TP_printk("dev %d:%d ino %#lx %s address %#lx zero_folio %p " "radix_entry %#lx", MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino, __entry->vm_flags & VM_SHARED ? "shared" : "private", __entry->address, - __entry->zero_page, + __entry->zero_folio, (unsigned long)__entry->radix_entry ) ) @@ -96,8 +96,8 @@ DECLARE_EVENT_CLASS(dax_pmd_load_hole_class, #define DEFINE_PMD_LOAD_HOLE_EVENT(name) \ DEFINE_EVENT(dax_pmd_load_hole_class, name, \ TP_PROTO(struct inode *inode, struct vm_fault *vmf, \ - struct page *zero_page, void *radix_entry), \ - TP_ARGS(inode, vmf, zero_page, radix_entry)) + struct folio *zero_folio, void *radix_entry), \ + TP_ARGS(inode, vmf, zero_folio, radix_entry)) DEFINE_PMD_LOAD_HOLE_EVENT(dax_pmd_load_hole); DEFINE_PMD_LOAD_HOLE_EVENT(dax_pmd_load_hole_fallback); diff --git a/include/trace/events/habanalabs.h b/include/trace/events/habanalabs.h index a78d21fa9f..4a2bb2c896 100644 --- a/include/trace/events/habanalabs.h +++ b/include/trace/events/habanalabs.h @@ -27,7 +27,7 @@ DECLARE_EVENT_CLASS(habanalabs_mmu_template, ), TP_fast_assign( - __assign_str(dname, dev_name(dev)); + __assign_str(dname); __entry->virt_addr = virt_addr; __entry->phys_addr = phys_addr; __entry->page_size = page_size; @@ -64,7 +64,7 @@ DECLARE_EVENT_CLASS(habanalabs_dma_alloc_template, ), TP_fast_assign( - __assign_str(dname, dev_name(dev)); + __assign_str(dname); __entry->cpu_addr = cpu_addr; __entry->dma_addr = dma_addr; __entry->size = size; @@ -103,7 +103,7 @@ DECLARE_EVENT_CLASS(habanalabs_dma_map_template, ), TP_fast_assign( - __assign_str(dname, dev_name(dev)); + __assign_str(dname); __entry->phys_addr = phys_addr; __entry->dma_addr = dma_addr; __entry->len = len; @@ -141,7 +141,7 @@ DECLARE_EVENT_CLASS(habanalabs_comms_template, ), TP_fast_assign( - __assign_str(dname, dev_name(dev)); + __assign_str(dname); __entry->op_str = op_str; ), @@ -178,7 +178,7 @@ DECLARE_EVENT_CLASS(habanalabs_reg_access_template, ), TP_fast_assign( - __assign_str(dname, dev_name(dev)); + __assign_str(dname); __entry->addr = addr; __entry->val = val; ), diff --git a/include/trace/events/huge_memory.h b/include/trace/events/huge_memory.h index 6e2ef1d4b0..b5f5369b63 100644 --- a/include/trace/events/huge_memory.h +++ b/include/trace/events/huge_memory.h @@ -174,10 +174,10 @@ TRACE_EVENT(mm_collapse_huge_page_swapin, TRACE_EVENT(mm_khugepaged_scan_file, - TP_PROTO(struct mm_struct *mm, struct page *page, struct file *file, + TP_PROTO(struct mm_struct *mm, struct folio *folio, struct file *file, int present, int swap, int result), - TP_ARGS(mm, page, file, present, swap, result), + TP_ARGS(mm, folio, file, present, swap, result), TP_STRUCT__entry( __field(struct mm_struct *, mm) @@ -190,8 +190,8 @@ TRACE_EVENT(mm_khugepaged_scan_file, TP_fast_assign( __entry->mm = mm; - __entry->pfn = page ? page_to_pfn(page) : -1; - __assign_str(filename, file->f_path.dentry->d_iname); + __entry->pfn = folio ? folio_pfn(folio) : -1; + __assign_str(filename); __entry->present = present; __entry->swap = swap; __entry->result = result; @@ -207,10 +207,10 @@ TRACE_EVENT(mm_khugepaged_scan_file, ); TRACE_EVENT(mm_khugepaged_collapse_file, - TP_PROTO(struct mm_struct *mm, struct page *hpage, pgoff_t index, + TP_PROTO(struct mm_struct *mm, struct folio *new_folio, pgoff_t index, bool is_shmem, unsigned long addr, struct file *file, int nr, int result), - TP_ARGS(mm, hpage, index, addr, is_shmem, file, nr, result), + TP_ARGS(mm, new_folio, index, addr, is_shmem, file, nr, result), TP_STRUCT__entry( __field(struct mm_struct *, mm) __field(unsigned long, hpfn) @@ -224,11 +224,11 @@ TRACE_EVENT(mm_khugepaged_collapse_file, TP_fast_assign( __entry->mm = mm; - __entry->hpfn = hpage ? page_to_pfn(hpage) : -1; + __entry->hpfn = new_folio ? folio_pfn(new_folio) : -1; __entry->index = index; __entry->addr = addr; __entry->is_shmem = is_shmem; - __assign_str(filename, file->f_path.dentry->d_iname); + __assign_str(filename); __entry->nr = nr; __entry->result = result; ), diff --git a/include/trace/events/thermal_pressure.h b/include/trace/events/hw_pressure.h index b686802013..b9cd688541 100644 --- a/include/trace/events/thermal_pressure.h +++ b/include/trace/events/hw_pressure.h @@ -1,27 +1,27 @@ /* SPDX-License-Identifier: GPL-2.0 */ #undef TRACE_SYSTEM -#define TRACE_SYSTEM thermal_pressure +#define TRACE_SYSTEM hw_pressure #if !defined(_TRACE_THERMAL_PRESSURE_H) || defined(TRACE_HEADER_MULTI_READ) #define _TRACE_THERMAL_PRESSURE_H #include <linux/tracepoint.h> -TRACE_EVENT(thermal_pressure_update, - TP_PROTO(int cpu, unsigned long thermal_pressure), - TP_ARGS(cpu, thermal_pressure), +TRACE_EVENT(hw_pressure_update, + TP_PROTO(int cpu, unsigned long hw_pressure), + TP_ARGS(cpu, hw_pressure), TP_STRUCT__entry( - __field(unsigned long, thermal_pressure) + __field(unsigned long, hw_pressure) __field(int, cpu) ), TP_fast_assign( - __entry->thermal_pressure = thermal_pressure; + __entry->hw_pressure = hw_pressure; __entry->cpu = cpu; ), - TP_printk("cpu=%d thermal_pressure=%lu", __entry->cpu, __entry->thermal_pressure) + TP_printk("cpu=%d hw_pressure=%lu", __entry->cpu, __entry->hw_pressure) ); #endif /* _TRACE_THERMAL_PRESSURE_H */ diff --git a/include/trace/events/hwmon.h b/include/trace/events/hwmon.h index d7a1d0ffb6..d1ff560cd9 100644 --- a/include/trace/events/hwmon.h +++ b/include/trace/events/hwmon.h @@ -21,7 +21,7 @@ DECLARE_EVENT_CLASS(hwmon_attr_class, TP_fast_assign( __entry->index = index; - __assign_str(attr_name, attr_name); + __assign_str(attr_name); __entry->val = val; ), @@ -57,8 +57,8 @@ TRACE_EVENT(hwmon_attr_show_string, TP_fast_assign( __entry->index = index; - __assign_str(attr_name, attr_name); - __assign_str(label, s); + __assign_str(attr_name); + __assign_str(label); ), TP_printk("index=%d, attr_name=%s, val=%s", diff --git a/include/trace/events/icmp.h b/include/trace/events/icmp.h new file mode 100644 index 0000000000..3155979694 --- /dev/null +++ b/include/trace/events/icmp.h @@ -0,0 +1,67 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM icmp + +#if !defined(_TRACE_ICMP_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_ICMP_H + +#include <linux/icmp.h> +#include <linux/tracepoint.h> + +TRACE_EVENT(icmp_send, + + TP_PROTO(const struct sk_buff *skb, int type, int code), + + TP_ARGS(skb, type, code), + + TP_STRUCT__entry( + __field(const void *, skbaddr) + __field(int, type) + __field(int, code) + __array(__u8, saddr, 4) + __array(__u8, daddr, 4) + __field(__u16, sport) + __field(__u16, dport) + __field(unsigned short, ulen) + ), + + TP_fast_assign( + struct iphdr *iph = ip_hdr(skb); + struct udphdr *uh = udp_hdr(skb); + int proto_4 = iph->protocol; + __be32 *p32; + + __entry->skbaddr = skb; + __entry->type = type; + __entry->code = code; + + if (proto_4 != IPPROTO_UDP || (u8 *)uh < skb->head || + (u8 *)uh + sizeof(struct udphdr) + > skb_tail_pointer(skb)) { + __entry->sport = 0; + __entry->dport = 0; + __entry->ulen = 0; + } else { + __entry->sport = ntohs(uh->source); + __entry->dport = ntohs(uh->dest); + __entry->ulen = ntohs(uh->len); + } + + p32 = (__be32 *) __entry->saddr; + *p32 = iph->saddr; + + p32 = (__be32 *) __entry->daddr; + *p32 = iph->daddr; + ), + + TP_printk("icmp_send: type=%d, code=%d. From %pI4:%u to %pI4:%u ulen=%d skbaddr=%p", + __entry->type, __entry->code, + __entry->saddr, __entry->sport, __entry->daddr, + __entry->dport, __entry->ulen, __entry->skbaddr) +); + +#endif /* _TRACE_ICMP_H */ + +/* This part must be outside protection */ +#include <trace/define_trace.h> + diff --git a/include/trace/events/initcall.h b/include/trace/events/initcall.h index eb903c3f19..5282afdf3d 100644 --- a/include/trace/events/initcall.h +++ b/include/trace/events/initcall.h @@ -18,7 +18,7 @@ TRACE_EVENT(initcall_level, ), TP_fast_assign( - __assign_str(level, level); + __assign_str(level); ), TP_printk("level=%s", __get_str(level)) diff --git a/include/trace/events/intel_ifs.h b/include/trace/events/intel_ifs.h index 8ce2de120f..0d88ebf2c9 100644 --- a/include/trace/events/intel_ifs.h +++ b/include/trace/events/intel_ifs.h @@ -28,7 +28,7 @@ TRACE_EVENT(ifs_status, __entry->status = status; ), - TP_printk("batch: %.2d, start: %.4x, stop: %.4x, status: %.16llx", + TP_printk("batch: 0x%.2x, start: 0x%.4x, stop: 0x%.4x, status: 0x%.16llx", __entry->batch, __entry->start, __entry->stop, diff --git a/include/trace/events/intel_ish.h b/include/trace/events/intel_ish.h index e6d7ff55ee..64b6612c41 100644 --- a/include/trace/events/intel_ish.h +++ b/include/trace/events/intel_ish.h @@ -18,7 +18,7 @@ TRACE_EVENT(ishtp_dump, ), TP_fast_assign( - __assign_str(message, message); + __assign_str(message); ), TP_printk("%s", __get_str(message)) diff --git a/include/trace/events/io_uring.h b/include/trace/events/io_uring.h index e948df7ce6..412c9c210a 100644 --- a/include/trace/events/io_uring.h +++ b/include/trace/events/io_uring.h @@ -164,7 +164,7 @@ TRACE_EVENT(io_uring_queue_async_work, __entry->work = &req->work; __entry->rw = rw; - __assign_str(op_str, io_uring_get_opcode(req->opcode)); + __assign_str(op_str); ), TP_printk("ring %p, request %p, user_data 0x%llx, opcode %s, flags 0x%llx, %s queue, work %p", @@ -202,7 +202,7 @@ TRACE_EVENT(io_uring_defer, __entry->data = req->cqe.user_data; __entry->opcode = req->opcode; - __assign_str(op_str, io_uring_get_opcode(req->opcode)); + __assign_str(op_str); ), TP_printk("ring %p, request %p, user_data 0x%llx, opcode %s", @@ -303,7 +303,7 @@ TRACE_EVENT(io_uring_fail_link, __entry->opcode = req->opcode; __entry->link = link; - __assign_str(op_str, io_uring_get_opcode(req->opcode)); + __assign_str(op_str); ), TP_printk("ring %p, request %p, user_data 0x%llx, opcode %s, link %p", @@ -392,7 +392,7 @@ TRACE_EVENT(io_uring_submit_req, __entry->flags = (__force unsigned long long) req->flags; __entry->sq_thread = req->ctx->flags & IORING_SETUP_SQPOLL; - __assign_str(op_str, io_uring_get_opcode(req->opcode)); + __assign_str(op_str); ), TP_printk("ring %p, req %p, user_data 0x%llx, opcode %s, flags 0x%llx, " @@ -436,7 +436,7 @@ TRACE_EVENT(io_uring_poll_arm, __entry->mask = mask; __entry->events = events; - __assign_str(op_str, io_uring_get_opcode(req->opcode)); + __assign_str(op_str); ), TP_printk("ring %p, req %p, user_data 0x%llx, opcode %s, mask 0x%x, events 0x%x", @@ -475,7 +475,7 @@ TRACE_EVENT(io_uring_task_add, __entry->opcode = req->opcode; __entry->mask = mask; - __assign_str(op_str, io_uring_get_opcode(req->opcode)); + __assign_str(op_str); ), TP_printk("ring %p, req %p, user_data 0x%llx, opcode %s, mask %x", @@ -538,7 +538,7 @@ TRACE_EVENT(io_uring_req_failed, __entry->addr3 = sqe->addr3; __entry->error = error; - __assign_str(op_str, io_uring_get_opcode(sqe->opcode)); + __assign_str(op_str); ), TP_printk("ring %p, req %p, user_data 0x%llx, " diff --git a/include/trace/events/iocost.h b/include/trace/events/iocost.h index af8bfed528..e772b1bc60 100644 --- a/include/trace/events/iocost.h +++ b/include/trace/events/iocost.h @@ -34,8 +34,8 @@ DECLARE_EVENT_CLASS(iocost_iocg_state, ), TP_fast_assign( - __assign_str(devname, ioc_name(iocg->ioc)); - __assign_str(cgroup, path); + __assign_str(devname); + __assign_str(cgroup); __entry->now = now->now; __entry->vnow = now->vnow; __entry->vrate = iocg->ioc->vtime_base_rate; @@ -93,8 +93,8 @@ DECLARE_EVENT_CLASS(iocg_inuse_update, ), TP_fast_assign( - __assign_str(devname, ioc_name(iocg->ioc)); - __assign_str(cgroup, path); + __assign_str(devname); + __assign_str(cgroup); __entry->now = now->now; __entry->old_inuse = old_inuse; __entry->new_inuse = new_inuse; @@ -159,7 +159,7 @@ TRACE_EVENT(iocost_ioc_vrate_adj, ), TP_fast_assign( - __assign_str(devname, ioc_name(ioc)); + __assign_str(devname); __entry->old_vrate = ioc->vtime_base_rate; __entry->new_vrate = new_vrate; __entry->busy_level = ioc->busy_level; @@ -200,8 +200,8 @@ TRACE_EVENT(iocost_iocg_forgive_debt, ), TP_fast_assign( - __assign_str(devname, ioc_name(iocg->ioc)); - __assign_str(cgroup, path); + __assign_str(devname); + __assign_str(cgroup); __entry->now = now->now; __entry->vnow = now->vnow; __entry->usage_pct = usage_pct; diff --git a/include/trace/events/iommu.h b/include/trace/events/iommu.h index 70743db1fb..373007e567 100644 --- a/include/trace/events/iommu.h +++ b/include/trace/events/iommu.h @@ -28,7 +28,7 @@ DECLARE_EVENT_CLASS(iommu_group_event, TP_fast_assign( __entry->gid = group_id; - __assign_str(device, dev_name(dev)); + __assign_str(device); ), TP_printk("IOMMU: groupID=%d device=%s", @@ -62,7 +62,7 @@ DECLARE_EVENT_CLASS(iommu_device_event, ), TP_fast_assign( - __assign_str(device, dev_name(dev)); + __assign_str(device); ), TP_printk("IOMMU: device=%s", __get_str(device) @@ -138,8 +138,8 @@ DECLARE_EVENT_CLASS(iommu_error, ), TP_fast_assign( - __assign_str(device, dev_name(dev)); - __assign_str(driver, dev_driver_string(dev)); + __assign_str(device); + __assign_str(driver); __entry->iova = iova; __entry->flags = flags; ), diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h index a07b4607b6..837c1740d0 100644 --- a/include/trace/events/irq.h +++ b/include/trace/events/irq.h @@ -63,7 +63,7 @@ TRACE_EVENT(irq_handler_entry, TP_fast_assign( __entry->irq = irq; - __assign_str(name, action->name); + __assign_str(name); ), TP_printk("irq=%d name=%s", __entry->irq, __get_str(name)) diff --git a/include/trace/events/iscsi.h b/include/trace/events/iscsi.h index 8ff2a3ca5d..990fd154f5 100644 --- a/include/trace/events/iscsi.h +++ b/include/trace/events/iscsi.h @@ -30,7 +30,7 @@ DECLARE_EVENT_CLASS(iscsi_log_msg, ), TP_fast_assign( - __assign_str(dname, dev_name(dev)); + __assign_str(dname); __assign_vstr(msg, vaf->fmt, vaf->va); ), diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index 6e62cc64cd..8a829e0f6e 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h @@ -126,7 +126,7 @@ TRACE_EVENT(kmem_cache_free, TP_fast_assign( __entry->call_site = call_site; __entry->ptr = ptr; - __assign_str(name, s->name); + __assign_str(name); ), TP_printk("call_site=%pS ptr=%p name=%s", diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h index 011fba6b55..74e40d5d4a 100644 --- a/include/trace/events/kvm.h +++ b/include/trace/events/kvm.h @@ -456,21 +456,6 @@ TRACE_EVENT(kvm_unmap_hva_range, __entry->start, __entry->end) ); -TRACE_EVENT(kvm_set_spte_hva, - TP_PROTO(unsigned long hva), - TP_ARGS(hva), - - TP_STRUCT__entry( - __field( unsigned long, hva ) - ), - - TP_fast_assign( - __entry->hva = hva; - ), - - TP_printk("mmu notifier set pte hva: %#016lx", __entry->hva) -); - TRACE_EVENT(kvm_age_hva, TP_PROTO(unsigned long start, unsigned long end), TP_ARGS(start, end), diff --git a/include/trace/events/lock.h b/include/trace/events/lock.h index 9ebd081e05..8e89baa377 100644 --- a/include/trace/events/lock.h +++ b/include/trace/events/lock.h @@ -37,7 +37,7 @@ TRACE_EVENT(lock_acquire, TP_fast_assign( __entry->flags = (trylock ? 1 : 0) | (read ? 2 : 0); - __assign_str(name, lock->name); + __assign_str(name); __entry->lockdep_addr = lock; ), @@ -59,7 +59,7 @@ DECLARE_EVENT_CLASS(lock, ), TP_fast_assign( - __assign_str(name, lock->name); + __assign_str(name); __entry->lockdep_addr = lock; ), diff --git a/include/trace/events/mce.h b/include/trace/events/mce.h index 1391ada0da..f0f7b3cb20 100644 --- a/include/trace/events/mce.h +++ b/include/trace/events/mce.h @@ -9,6 +9,14 @@ #include <linux/tracepoint.h> #include <asm/mce.h> +/* + * MCE Event Record. + * + * Only very relevant and transient information which cannot be + * gathered from a system by any other means or which can only be + * acquired arduously should be added to this record. + */ + TRACE_EVENT(mce_record, TP_PROTO(struct mce *m), @@ -25,6 +33,7 @@ TRACE_EVENT(mce_record, __field( u64, ipid ) __field( u64, ip ) __field( u64, tsc ) + __field( u64, ppin ) __field( u64, walltime ) __field( u32, cpu ) __field( u32, cpuid ) @@ -33,6 +42,7 @@ TRACE_EVENT(mce_record, __field( u8, cs ) __field( u8, bank ) __field( u8, cpuvendor ) + __field( u32, microcode ) ), TP_fast_assign( @@ -45,6 +55,7 @@ TRACE_EVENT(mce_record, __entry->ipid = m->ipid; __entry->ip = m->ip; __entry->tsc = m->tsc; + __entry->ppin = m->ppin; __entry->walltime = m->time; __entry->cpu = m->extcpu; __entry->cpuid = m->cpuid; @@ -53,20 +64,26 @@ TRACE_EVENT(mce_record, __entry->cs = m->cs; __entry->bank = m->bank; __entry->cpuvendor = m->cpuvendor; + __entry->microcode = m->microcode; ), - TP_printk("CPU: %d, MCGc/s: %llx/%llx, MC%d: %016Lx, IPID: %016Lx, ADDR/MISC/SYND: %016Lx/%016Lx/%016Lx, RIP: %02x:<%016Lx>, TSC: %llx, PROCESSOR: %u:%x, TIME: %llu, SOCKET: %u, APIC: %x", + TP_printk("CPU: %d, MCGc/s: %llx/%llx, MC%d: %016Lx, IPID: %016Lx, ADDR: %016Lx, MISC: %016Lx, SYND: %016Lx, RIP: %02x:<%016Lx>, TSC: %llx, PPIN: %llx, vendor: %u, CPUID: %x, time: %llu, socket: %u, APIC: %x, microcode: %x", __entry->cpu, __entry->mcgcap, __entry->mcgstatus, __entry->bank, __entry->status, __entry->ipid, - __entry->addr, __entry->misc, __entry->synd, + __entry->addr, + __entry->misc, + __entry->synd, __entry->cs, __entry->ip, __entry->tsc, - __entry->cpuvendor, __entry->cpuid, + __entry->ppin, + __entry->cpuvendor, + __entry->cpuid, __entry->walltime, __entry->socketid, - __entry->apicid) + __entry->apicid, + __entry->microcode) ); #endif /* _TRACE_MCE_H */ diff --git a/include/trace/events/mdio.h b/include/trace/events/mdio.h index 0f241cbe00..285b3e4f83 100644 --- a/include/trace/events/mdio.h +++ b/include/trace/events/mdio.h @@ -25,7 +25,7 @@ TRACE_EVENT_CONDITION(mdio_access, ), TP_fast_assign( - strncpy(__entry->busid, bus->id, MII_BUS_ID_SIZE); + strscpy(__entry->busid, bus->id, MII_BUS_ID_SIZE); __entry->read = read; __entry->addr = addr; __entry->regnum = regnum; diff --git a/include/trace/events/mmap_lock.h b/include/trace/events/mmap_lock.h index 14db8044c1..f2827f98a4 100644 --- a/include/trace/events/mmap_lock.h +++ b/include/trace/events/mmap_lock.h @@ -27,7 +27,7 @@ DECLARE_EVENT_CLASS(mmap_lock, TP_fast_assign( __entry->mm = mm; - __assign_str(memcg_path, memcg_path); + __assign_str(memcg_path); __entry->write = write; ), @@ -65,7 +65,7 @@ TRACE_EVENT_FN(mmap_lock_acquire_returned, TP_fast_assign( __entry->mm = mm; - __assign_str(memcg_path, memcg_path); + __assign_str(memcg_path); __entry->write = write; __entry->success = success; ), diff --git a/include/trace/events/mmc.h b/include/trace/events/mmc.h index 7b706ff213..f1c2e94f7f 100644 --- a/include/trace/events/mmc.h +++ b/include/trace/events/mmc.h @@ -68,7 +68,7 @@ TRACE_EVENT(mmc_request_start, __entry->need_retune = host->need_retune; __entry->hold_retune = host->hold_retune; __entry->retune_period = host->retune_period; - __assign_str(name, mmc_hostname(host)); + __assign_str(name); __entry->mrq = mrq; ), @@ -156,7 +156,7 @@ TRACE_EVENT(mmc_request_done, __entry->need_retune = host->need_retune; __entry->hold_retune = host->hold_retune; __entry->retune_period = host->retune_period; - __assign_str(name, mmc_hostname(host)); + __assign_str(name); __entry->mrq = mrq; ), diff --git a/include/trace/events/mmflags.h b/include/trace/events/mmflags.h index d55e53ac91..e46d6e8276 100644 --- a/include/trace/events/mmflags.h +++ b/include/trace/events/mmflags.h @@ -107,7 +107,6 @@ DEF_PAGEFLAG_NAME(lru), \ DEF_PAGEFLAG_NAME(active), \ DEF_PAGEFLAG_NAME(workingset), \ - DEF_PAGEFLAG_NAME(slab), \ DEF_PAGEFLAG_NAME(owner_priv_1), \ DEF_PAGEFLAG_NAME(arch_1), \ DEF_PAGEFLAG_NAME(reserved), \ @@ -135,6 +134,7 @@ IF_HAVE_PG_ARCH_X(arch_3) #define DEF_PAGETYPE_NAME(_name) { PG_##_name, __stringify(_name) } #define __def_pagetype_names \ + DEF_PAGETYPE_NAME(slab), \ DEF_PAGETYPE_NAME(hugetlb), \ DEF_PAGETYPE_NAME(offline), \ DEF_PAGETYPE_NAME(guard), \ diff --git a/include/trace/events/module.h b/include/trace/events/module.h index 097485c73c..e5a006be9d 100644 --- a/include/trace/events/module.h +++ b/include/trace/events/module.h @@ -41,7 +41,7 @@ TRACE_EVENT(module_load, TP_fast_assign( __entry->taints = mod->taints; - __assign_str(name, mod->name); + __assign_str(name); ), TP_printk("%s %s", __get_str(name), show_module_flags(__entry->taints)) @@ -58,7 +58,7 @@ TRACE_EVENT(module_free, ), TP_fast_assign( - __assign_str(name, mod->name); + __assign_str(name); ), TP_printk("%s", __get_str(name)) @@ -82,7 +82,7 @@ DECLARE_EVENT_CLASS(module_refcnt, TP_fast_assign( __entry->ip = ip; __entry->refcnt = atomic_read(&mod->refcnt); - __assign_str(name, mod->name); + __assign_str(name); ), TP_printk("%s call_site=%ps refcnt=%d", @@ -119,7 +119,7 @@ TRACE_EVENT(module_request, TP_fast_assign( __entry->ip = ip; __entry->wait = wait; - __assign_str(name, name); + __assign_str(name); ), TP_printk("%s wait=%d call_site=%ps", diff --git a/include/trace/events/napi.h b/include/trace/events/napi.h index dc03cf8e03..b567b9ffed 100644 --- a/include/trace/events/napi.h +++ b/include/trace/events/napi.h @@ -26,7 +26,7 @@ TRACE_EVENT(napi_poll, TP_fast_assign( __entry->napi = napi; - __assign_str(dev_name, napi->dev ? napi->dev->name : NO_DEV); + __assign_str(dev_name); __entry->work = work; __entry->budget = budget; ), diff --git a/include/trace/events/nbd.h b/include/trace/events/nbd.h index 9849956f34..390d98a05c 100644 --- a/include/trace/events/nbd.h +++ b/include/trace/events/nbd.h @@ -72,7 +72,7 @@ DECLARE_EVENT_CLASS(nbd_send_request, ), TP_fast_assign( - __entry->nbd_request = 0; + __entry->nbd_request = NULL; __entry->dev_index = index; __entry->request = rq; ), diff --git a/include/trace/events/neigh.h b/include/trace/events/neigh.h index 833143d099..12362c35db 100644 --- a/include/trace/events/neigh.h +++ b/include/trace/events/neigh.h @@ -42,7 +42,7 @@ TRACE_EVENT(neigh_create, __be32 *p32; __entry->family = tbl->family; - __assign_str(dev, (dev ? dev->name : "NULL")); + __assign_str(dev); __entry->entries = atomic_read(&tbl->gc_entries); __entry->created = n != NULL; __entry->gc_exempt = exempt_from_gc; @@ -103,7 +103,7 @@ TRACE_EVENT(neigh_update, __be32 *p32; __entry->family = n->tbl->family; - __assign_str(dev, (n->dev ? n->dev->name : "NULL")); + __assign_str(dev); __entry->lladdr_len = lladdr_len; memcpy(__entry->lladdr, n->ha, lladdr_len); __entry->flags = n->flags; @@ -180,7 +180,7 @@ DECLARE_EVENT_CLASS(neigh__update, __be32 *p32; __entry->family = n->tbl->family; - __assign_str(dev, (n->dev ? n->dev->name : "NULL")); + __assign_str(dev); __entry->lladdr_len = lladdr_len; memcpy(__entry->lladdr, n->ha, lladdr_len); __entry->flags = n->flags; diff --git a/include/trace/events/net.h b/include/trace/events/net.h index f667c76a3b..d55162c12f 100644 --- a/include/trace/events/net.h +++ b/include/trace/events/net.h @@ -38,7 +38,7 @@ TRACE_EVENT(net_dev_start_xmit, ), TP_fast_assign( - __assign_str(name, dev->name); + __assign_str(name); __entry->queue_mapping = skb->queue_mapping; __entry->skbaddr = skb; __entry->vlan_tagged = skb_vlan_tag_present(skb); @@ -89,7 +89,7 @@ TRACE_EVENT(net_dev_xmit, __entry->skbaddr = skb; __entry->len = skb_len; __entry->rc = rc; - __assign_str(name, dev->name); + __assign_str(name); ), TP_printk("dev=%s skbaddr=%p len=%u rc=%d", @@ -110,8 +110,8 @@ TRACE_EVENT(net_dev_xmit_timeout, ), TP_fast_assign( - __assign_str(name, dev->name); - __assign_str(driver, netdev_drivername(dev)); + __assign_str(name); + __assign_str(driver); __entry->queue_index = queue_index; ), @@ -134,7 +134,7 @@ DECLARE_EVENT_CLASS(net_dev_template, TP_fast_assign( __entry->skbaddr = skb; __entry->len = skb->len; - __assign_str(name, skb->dev->name); + __assign_str(name); ), TP_printk("dev=%s skbaddr=%p len=%u", @@ -191,7 +191,7 @@ DECLARE_EVENT_CLASS(net_dev_rx_verbose_template, ), TP_fast_assign( - __assign_str(name, skb->dev->name); + __assign_str(name); #ifdef CONFIG_NET_RX_BUSY_POLL __entry->napi_id = skb->napi_id; #else diff --git a/include/trace/events/net_probe_common.h b/include/trace/events/net_probe_common.h index 3930119cab..976a58364b 100644 --- a/include/trace/events/net_probe_common.h +++ b/include/trace/events/net_probe_common.h @@ -41,4 +41,75 @@ #endif +#define TP_STORE_V4MAPPED(__entry, saddr, daddr) \ + do { \ + struct in6_addr *pin6; \ + \ + pin6 = (struct in6_addr *)__entry->saddr_v6; \ + ipv6_addr_set_v4mapped(saddr, pin6); \ + pin6 = (struct in6_addr *)__entry->daddr_v6; \ + ipv6_addr_set_v4mapped(daddr, pin6); \ + } while (0) + +#if IS_ENABLED(CONFIG_IPV6) +#define TP_STORE_ADDRS(__entry, saddr, daddr, saddr6, daddr6) \ + do { \ + if (sk->sk_family == AF_INET6) { \ + struct in6_addr *pin6; \ + \ + pin6 = (struct in6_addr *)__entry->saddr_v6; \ + *pin6 = saddr6; \ + pin6 = (struct in6_addr *)__entry->daddr_v6; \ + *pin6 = daddr6; \ + } else { \ + TP_STORE_V4MAPPED(__entry, saddr, daddr); \ + } \ + } while (0) +#else +#define TP_STORE_ADDRS(__entry, saddr, daddr, saddr6, daddr6) \ + TP_STORE_V4MAPPED(__entry, saddr, daddr) +#endif + +#define TP_STORE_ADDR_PORTS_SKB_V4(skb, protoh, entry_saddr, entry_daddr) \ + do { \ + struct sockaddr_in *v4 = (void *)entry_saddr; \ + \ + v4->sin_family = AF_INET; \ + v4->sin_port = protoh->source; \ + v4->sin_addr.s_addr = ip_hdr(skb)->saddr; \ + v4 = (void *)entry_daddr; \ + v4->sin_family = AF_INET; \ + v4->sin_port = protoh->dest; \ + v4->sin_addr.s_addr = ip_hdr(skb)->daddr; \ + } while (0) + +#if IS_ENABLED(CONFIG_IPV6) + +#define TP_STORE_ADDR_PORTS_SKB(skb, protoh, entry_saddr, entry_daddr) \ + do { \ + const struct iphdr *iph = ip_hdr(skb); \ + \ + if (iph->version == 6) { \ + struct sockaddr_in6 *v6 = (void *)entry_saddr; \ + \ + v6->sin6_family = AF_INET6; \ + v6->sin6_port = protoh->source; \ + v6->sin6_addr = ipv6_hdr(skb)->saddr; \ + v6 = (void *)entry_daddr; \ + v6->sin6_family = AF_INET6; \ + v6->sin6_port = protoh->dest; \ + v6->sin6_addr = ipv6_hdr(skb)->daddr; \ + } else \ + TP_STORE_ADDR_PORTS_SKB_V4(skb, protoh, \ + entry_saddr, \ + entry_daddr); \ + } while (0) + +#else + +#define TP_STORE_ADDR_PORTS_SKB(skb, protoh, entry_saddr, entry_daddr) \ + TP_STORE_ADDR_PORTS_SKB_V4(skb, protoh, entry_saddr, entry_daddr) + +#endif + #endif diff --git a/include/trace/events/netfs.h b/include/trace/events/netfs.h index 447a8c21cf..da23484268 100644 --- a/include/trace/events/netfs.h +++ b/include/trace/events/netfs.h @@ -24,8 +24,8 @@ E_(netfs_read_trace_write_begin, "WRITEBEGN") #define netfs_write_traces \ + EM(netfs_write_trace_copy_to_cache, "COPY2CACH") \ EM(netfs_write_trace_dio_write, "DIO-WRITE") \ - EM(netfs_write_trace_launder, "LAUNDER ") \ EM(netfs_write_trace_unbuffered_write, "UNB-WRITE") \ EM(netfs_write_trace_writeback, "WRITEBACK") \ E_(netfs_write_trace_writethrough, "WRITETHRU") @@ -34,9 +34,9 @@ EM(NETFS_READAHEAD, "RA") \ EM(NETFS_READPAGE, "RP") \ EM(NETFS_READ_FOR_WRITE, "RW") \ + EM(NETFS_COPY_TO_CACHE, "CC") \ EM(NETFS_WRITEBACK, "WB") \ EM(NETFS_WRITETHROUGH, "WT") \ - EM(NETFS_LAUNDER_WRITE, "LW") \ EM(NETFS_UNBUFFERED_WRITE, "UW") \ EM(NETFS_DIO_READ, "DR") \ E_(NETFS_DIO_WRITE, "DW") @@ -44,14 +44,18 @@ #define netfs_rreq_traces \ EM(netfs_rreq_trace_assess, "ASSESS ") \ EM(netfs_rreq_trace_copy, "COPY ") \ + EM(netfs_rreq_trace_collect, "COLLECT") \ EM(netfs_rreq_trace_done, "DONE ") \ EM(netfs_rreq_trace_free, "FREE ") \ EM(netfs_rreq_trace_redirty, "REDIRTY") \ EM(netfs_rreq_trace_resubmit, "RESUBMT") \ + EM(netfs_rreq_trace_set_pause, "PAUSE ") \ EM(netfs_rreq_trace_unlock, "UNLOCK ") \ EM(netfs_rreq_trace_unmark, "UNMARK ") \ EM(netfs_rreq_trace_wait_ip, "WAIT-IP") \ + EM(netfs_rreq_trace_wait_pause, "WT-PAUS") \ EM(netfs_rreq_trace_wake_ip, "WAKE-IP") \ + EM(netfs_rreq_trace_unpause, "UNPAUSE") \ E_(netfs_rreq_trace_write_done, "WR-DONE") #define netfs_sreq_sources \ @@ -64,11 +68,15 @@ E_(NETFS_INVALID_WRITE, "INVL") #define netfs_sreq_traces \ + EM(netfs_sreq_trace_discard, "DSCRD") \ EM(netfs_sreq_trace_download_instead, "RDOWN") \ + EM(netfs_sreq_trace_fail, "FAIL ") \ EM(netfs_sreq_trace_free, "FREE ") \ EM(netfs_sreq_trace_limited, "LIMIT") \ EM(netfs_sreq_trace_prepare, "PREP ") \ + EM(netfs_sreq_trace_prep_failed, "PRPFL") \ EM(netfs_sreq_trace_resubmit_short, "SHORT") \ + EM(netfs_sreq_trace_retry, "RETRY") \ EM(netfs_sreq_trace_submit, "SUBMT") \ EM(netfs_sreq_trace_terminated, "TERM ") \ EM(netfs_sreq_trace_write, "WRITE") \ @@ -88,6 +96,7 @@ #define netfs_rreq_ref_traces \ EM(netfs_rreq_trace_get_for_outstanding,"GET OUTSTND") \ EM(netfs_rreq_trace_get_subreq, "GET SUBREQ ") \ + EM(netfs_rreq_trace_get_work, "GET WORK ") \ EM(netfs_rreq_trace_put_complete, "PUT COMPLT ") \ EM(netfs_rreq_trace_put_discard, "PUT DISCARD") \ EM(netfs_rreq_trace_put_failed, "PUT FAILED ") \ @@ -95,19 +104,25 @@ EM(netfs_rreq_trace_put_return, "PUT RETURN ") \ EM(netfs_rreq_trace_put_subreq, "PUT SUBREQ ") \ EM(netfs_rreq_trace_put_work, "PUT WORK ") \ + EM(netfs_rreq_trace_put_work_complete, "PUT WORK CP") \ + EM(netfs_rreq_trace_put_work_nq, "PUT WORK NQ") \ EM(netfs_rreq_trace_see_work, "SEE WORK ") \ E_(netfs_rreq_trace_new, "NEW ") #define netfs_sreq_ref_traces \ EM(netfs_sreq_trace_get_copy_to_cache, "GET COPY2C ") \ EM(netfs_sreq_trace_get_resubmit, "GET RESUBMIT") \ + EM(netfs_sreq_trace_get_submit, "GET SUBMIT") \ EM(netfs_sreq_trace_get_short_read, "GET SHORTRD") \ EM(netfs_sreq_trace_new, "NEW ") \ + EM(netfs_sreq_trace_put_cancel, "PUT CANCEL ") \ EM(netfs_sreq_trace_put_clear, "PUT CLEAR ") \ EM(netfs_sreq_trace_put_discard, "PUT DISCARD") \ + EM(netfs_sreq_trace_put_done, "PUT DONE ") \ EM(netfs_sreq_trace_put_failed, "PUT FAILED ") \ EM(netfs_sreq_trace_put_merged, "PUT MERGED ") \ EM(netfs_sreq_trace_put_no_copy, "PUT NO COPY") \ + EM(netfs_sreq_trace_put_oom, "PUT OOM ") \ EM(netfs_sreq_trace_put_wip, "PUT WIP ") \ EM(netfs_sreq_trace_put_work, "PUT WORK ") \ E_(netfs_sreq_trace_put_terminated, "PUT TERM ") @@ -124,24 +139,33 @@ EM(netfs_streaming_filled_page, "mod-streamw-f") \ EM(netfs_streaming_cont_filled_page, "mod-streamw-f+") \ /* The rest are for writeback */ \ + EM(netfs_folio_trace_cancel_copy, "cancel-copy") \ EM(netfs_folio_trace_clear, "clear") \ - EM(netfs_folio_trace_clear_s, "clear-s") \ + EM(netfs_folio_trace_clear_cc, "clear-cc") \ EM(netfs_folio_trace_clear_g, "clear-g") \ - EM(netfs_folio_trace_copy_to_cache, "copy") \ - EM(netfs_folio_trace_end_copy, "end-copy") \ + EM(netfs_folio_trace_clear_s, "clear-s") \ + EM(netfs_folio_trace_copy_to_cache, "mark-copy") \ EM(netfs_folio_trace_filled_gaps, "filled-gaps") \ EM(netfs_folio_trace_kill, "kill") \ - EM(netfs_folio_trace_launder, "launder") \ + EM(netfs_folio_trace_kill_cc, "kill-cc") \ + EM(netfs_folio_trace_kill_g, "kill-g") \ + EM(netfs_folio_trace_kill_s, "kill-s") \ EM(netfs_folio_trace_mkwrite, "mkwrite") \ EM(netfs_folio_trace_mkwrite_plus, "mkwrite+") \ + EM(netfs_folio_trace_not_under_wback, "!wback") \ EM(netfs_folio_trace_read_gaps, "read-gaps") \ - EM(netfs_folio_trace_redirty, "redirty") \ EM(netfs_folio_trace_redirtied, "redirtied") \ EM(netfs_folio_trace_store, "store") \ + EM(netfs_folio_trace_store_copy, "store-copy") \ EM(netfs_folio_trace_store_plus, "store+") \ EM(netfs_folio_trace_wthru, "wthru") \ E_(netfs_folio_trace_wthru_plus, "wthru+") +#define netfs_collect_contig_traces \ + EM(netfs_contig_trace_collect, "Collect") \ + EM(netfs_contig_trace_jump, "-->JUMP-->") \ + E_(netfs_contig_trace_unlock, "Unlock") + #ifndef __NETFS_DECLARE_TRACE_ENUMS_ONCE_ONLY #define __NETFS_DECLARE_TRACE_ENUMS_ONCE_ONLY @@ -158,6 +182,7 @@ enum netfs_failure { netfs_failures } __mode(byte); enum netfs_rreq_ref_trace { netfs_rreq_ref_traces } __mode(byte); enum netfs_sreq_ref_trace { netfs_sreq_ref_traces } __mode(byte); enum netfs_folio_trace { netfs_folio_traces } __mode(byte); +enum netfs_collect_contig_trace { netfs_collect_contig_traces } __mode(byte); #endif @@ -179,6 +204,7 @@ netfs_failures; netfs_rreq_ref_traces; netfs_sreq_ref_traces; netfs_folio_traces; +netfs_collect_contig_traces; /* * Now redefine the EM() and E_() macros to map the enums to the strings that @@ -279,7 +305,7 @@ TRACE_EVENT(netfs_sreq, __entry->start = sreq->start; ), - TP_printk("R=%08x[%u] %s %s f=%02x s=%llx %zx/%zx e=%d", + TP_printk("R=%08x[%x] %s %s f=%02x s=%llx %zx/%zx e=%d", __entry->rreq, __entry->index, __print_symbolic(__entry->source, netfs_sreq_sources), __print_symbolic(__entry->what, netfs_sreq_traces), @@ -319,7 +345,7 @@ TRACE_EVENT(netfs_failure, __entry->start = sreq ? sreq->start : 0; ), - TP_printk("R=%08x[%d] %s f=%02x s=%llx %zx/%zx %s e=%d", + TP_printk("R=%08x[%x] %s f=%02x s=%llx %zx/%zx %s e=%d", __entry->rreq, __entry->index, __print_symbolic(__entry->source, netfs_sreq_sources), __entry->flags, @@ -412,16 +438,18 @@ TRACE_EVENT(netfs_write_iter, __field(unsigned long long, start ) __field(size_t, len ) __field(unsigned int, flags ) + __field(unsigned int, ino ) ), TP_fast_assign( __entry->start = iocb->ki_pos; __entry->len = iov_iter_count(from); + __entry->ino = iocb->ki_filp->f_inode->i_ino; __entry->flags = iocb->ki_flags; ), - TP_printk("WRITE-ITER s=%llx l=%zx f=%x", - __entry->start, __entry->len, __entry->flags) + TP_printk("WRITE-ITER i=%x s=%llx l=%zx f=%x", + __entry->ino, __entry->start, __entry->len, __entry->flags) ); TRACE_EVENT(netfs_write, @@ -433,9 +461,10 @@ TRACE_EVENT(netfs_write, TP_STRUCT__entry( __field(unsigned int, wreq ) __field(unsigned int, cookie ) + __field(unsigned int, ino ) __field(enum netfs_write_trace, what ) __field(unsigned long long, start ) - __field(size_t, len ) + __field(unsigned long long, len ) ), TP_fast_assign( @@ -443,18 +472,213 @@ TRACE_EVENT(netfs_write, struct fscache_cookie *__cookie = netfs_i_cookie(__ctx); __entry->wreq = wreq->debug_id; __entry->cookie = __cookie ? __cookie->debug_id : 0; + __entry->ino = wreq->inode->i_ino; __entry->what = what; __entry->start = wreq->start; __entry->len = wreq->len; ), - TP_printk("R=%08x %s c=%08x by=%llx-%llx", + TP_printk("R=%08x %s c=%08x i=%x by=%llx-%llx", __entry->wreq, __print_symbolic(__entry->what, netfs_write_traces), __entry->cookie, + __entry->ino, __entry->start, __entry->start + __entry->len - 1) ); +TRACE_EVENT(netfs_collect, + TP_PROTO(const struct netfs_io_request *wreq), + + TP_ARGS(wreq), + + TP_STRUCT__entry( + __field(unsigned int, wreq ) + __field(unsigned int, len ) + __field(unsigned long long, transferred ) + __field(unsigned long long, start ) + ), + + TP_fast_assign( + __entry->wreq = wreq->debug_id; + __entry->start = wreq->start; + __entry->len = wreq->len; + __entry->transferred = wreq->transferred; + ), + + TP_printk("R=%08x s=%llx-%llx", + __entry->wreq, + __entry->start + __entry->transferred, + __entry->start + __entry->len) + ); + +TRACE_EVENT(netfs_collect_contig, + TP_PROTO(const struct netfs_io_request *wreq, unsigned long long to, + enum netfs_collect_contig_trace type), + + TP_ARGS(wreq, to, type), + + TP_STRUCT__entry( + __field(unsigned int, wreq) + __field(enum netfs_collect_contig_trace, type) + __field(unsigned long long, contiguity) + __field(unsigned long long, to) + ), + + TP_fast_assign( + __entry->wreq = wreq->debug_id; + __entry->type = type; + __entry->contiguity = wreq->contiguity; + __entry->to = to; + ), + + TP_printk("R=%08x %llx -> %llx %s", + __entry->wreq, + __entry->contiguity, + __entry->to, + __print_symbolic(__entry->type, netfs_collect_contig_traces)) + ); + +TRACE_EVENT(netfs_collect_sreq, + TP_PROTO(const struct netfs_io_request *wreq, + const struct netfs_io_subrequest *subreq), + + TP_ARGS(wreq, subreq), + + TP_STRUCT__entry( + __field(unsigned int, wreq ) + __field(unsigned int, subreq ) + __field(unsigned int, stream ) + __field(unsigned int, len ) + __field(unsigned int, transferred ) + __field(unsigned long long, start ) + ), + + TP_fast_assign( + __entry->wreq = wreq->debug_id; + __entry->subreq = subreq->debug_index; + __entry->stream = subreq->stream_nr; + __entry->start = subreq->start; + __entry->len = subreq->len; + __entry->transferred = subreq->transferred; + ), + + TP_printk("R=%08x[%u:%02x] s=%llx t=%x/%x", + __entry->wreq, __entry->stream, __entry->subreq, + __entry->start, __entry->transferred, __entry->len) + ); + +TRACE_EVENT(netfs_collect_folio, + TP_PROTO(const struct netfs_io_request *wreq, + const struct folio *folio, + unsigned long long fend, + unsigned long long collected_to), + + TP_ARGS(wreq, folio, fend, collected_to), + + TP_STRUCT__entry( + __field(unsigned int, wreq ) + __field(unsigned long, index ) + __field(unsigned long long, fend ) + __field(unsigned long long, cleaned_to ) + __field(unsigned long long, collected_to ) + ), + + TP_fast_assign( + __entry->wreq = wreq->debug_id; + __entry->index = folio->index; + __entry->fend = fend; + __entry->cleaned_to = wreq->cleaned_to; + __entry->collected_to = collected_to; + ), + + TP_printk("R=%08x ix=%05lx r=%llx-%llx t=%llx/%llx", + __entry->wreq, __entry->index, + (unsigned long long)__entry->index * PAGE_SIZE, __entry->fend, + __entry->cleaned_to, __entry->collected_to) + ); + +TRACE_EVENT(netfs_collect_state, + TP_PROTO(const struct netfs_io_request *wreq, + unsigned long long collected_to, + unsigned int notes), + + TP_ARGS(wreq, collected_to, notes), + + TP_STRUCT__entry( + __field(unsigned int, wreq ) + __field(unsigned int, notes ) + __field(unsigned long long, collected_to ) + __field(unsigned long long, cleaned_to ) + __field(unsigned long long, contiguity ) + ), + + TP_fast_assign( + __entry->wreq = wreq->debug_id; + __entry->notes = notes; + __entry->collected_to = collected_to; + __entry->cleaned_to = wreq->cleaned_to; + __entry->contiguity = wreq->contiguity; + ), + + TP_printk("R=%08x cto=%llx fto=%llx ctg=%llx n=%x", + __entry->wreq, __entry->collected_to, + __entry->cleaned_to, __entry->contiguity, + __entry->notes) + ); + +TRACE_EVENT(netfs_collect_gap, + TP_PROTO(const struct netfs_io_request *wreq, + const struct netfs_io_stream *stream, + unsigned long long jump_to, char type), + + TP_ARGS(wreq, stream, jump_to, type), + + TP_STRUCT__entry( + __field(unsigned int, wreq) + __field(unsigned char, stream) + __field(unsigned char, type) + __field(unsigned long long, from) + __field(unsigned long long, to) + ), + + TP_fast_assign( + __entry->wreq = wreq->debug_id; + __entry->stream = stream->stream_nr; + __entry->from = stream->collected_to; + __entry->to = jump_to; + __entry->type = type; + ), + + TP_printk("R=%08x[%x:] %llx->%llx %c", + __entry->wreq, __entry->stream, + __entry->from, __entry->to, __entry->type) + ); + +TRACE_EVENT(netfs_collect_stream, + TP_PROTO(const struct netfs_io_request *wreq, + const struct netfs_io_stream *stream), + + TP_ARGS(wreq, stream), + + TP_STRUCT__entry( + __field(unsigned int, wreq) + __field(unsigned char, stream) + __field(unsigned long long, collected_to) + __field(unsigned long long, front) + ), + + TP_fast_assign( + __entry->wreq = wreq->debug_id; + __entry->stream = stream->stream_nr; + __entry->collected_to = stream->collected_to; + __entry->front = stream->front ? stream->front->start : UINT_MAX; + ), + + TP_printk("R=%08x[%x:] cto=%llx frn=%llx", + __entry->wreq, __entry->stream, + __entry->collected_to, __entry->front) + ); + #undef EM #undef E_ #endif /* _TRACE_NETFS_H */ diff --git a/include/trace/events/netlink.h b/include/trace/events/netlink.h index 3b7be3b386..f036b8a205 100644 --- a/include/trace/events/netlink.h +++ b/include/trace/events/netlink.h @@ -17,7 +17,7 @@ TRACE_EVENT(netlink_extack, ), TP_fast_assign( - __assign_str(msg, msg); + __assign_str(msg); ), TP_printk("msg=%s", __get_str(msg)) diff --git a/include/trace/events/nilfs2.h b/include/trace/events/nilfs2.h index 8efc6236f5..8880c11733 100644 --- a/include/trace/events/nilfs2.h +++ b/include/trace/events/nilfs2.h @@ -200,7 +200,11 @@ TRACE_EVENT(nilfs2_mdt_submit_block, __field(struct inode *, inode) __field(unsigned long, ino) __field(unsigned long, blkoff) - __field(enum req_op, mode) + /* + * Use field_struct() to avoid is_signed_type() on the + * bitwise type enum req_op. + */ + __field_struct(enum req_op, mode) ), TP_fast_assign( diff --git a/include/trace/events/oom.h b/include/trace/events/oom.h index b799f3bcba..a42be4c856 100644 --- a/include/trace/events/oom.h +++ b/include/trace/events/oom.h @@ -92,7 +92,7 @@ TRACE_EVENT(mark_victim, TP_fast_assign( __entry->pid = task->pid; - __assign_str(comm, task->comm); + __assign_str(comm); __entry->total_vm = PG_COUNT_TO_KB(task->mm->total_vm); __entry->anon_rss = PG_COUNT_TO_KB(get_mm_counter(task->mm, MM_ANONPAGES)); __entry->file_rss = PG_COUNT_TO_KB(get_mm_counter(task->mm, MM_FILEPAGES)); diff --git a/include/trace/events/osnoise.h b/include/trace/events/osnoise.h index 82f741ec0f..a2379a4f06 100644 --- a/include/trace/events/osnoise.h +++ b/include/trace/events/osnoise.h @@ -75,7 +75,7 @@ TRACE_EVENT(irq_noise, ), TP_fast_assign( - __assign_str(desc, desc); + __assign_str(desc); __entry->vector = vector; __entry->start = start; __entry->duration = duration; diff --git a/include/trace/events/page_ref.h b/include/trace/events/page_ref.h index 8a99c1cd41..fe33a255b7 100644 --- a/include/trace/events/page_ref.h +++ b/include/trace/events/page_ref.h @@ -30,7 +30,7 @@ DECLARE_EVENT_CLASS(page_ref_mod_template, __entry->pfn = page_to_pfn(page); __entry->flags = page->flags; __entry->count = page_ref_count(page); - __entry->mapcount = page_mapcount(page); + __entry->mapcount = atomic_read(&page->_mapcount); __entry->mapping = page->mapping; __entry->mt = get_pageblock_migratetype(page); __entry->val = v; @@ -79,7 +79,7 @@ DECLARE_EVENT_CLASS(page_ref_mod_and_test_template, __entry->pfn = page_to_pfn(page); __entry->flags = page->flags; __entry->count = page_ref_count(page); - __entry->mapcount = page_mapcount(page); + __entry->mapcount = atomic_read(&page->_mapcount); __entry->mapping = page->mapping; __entry->mt = get_pageblock_migratetype(page); __entry->val = v; diff --git a/include/trace/events/power.h b/include/trace/events/power.h index 77f14f7a11..d2349b6b53 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h @@ -76,7 +76,7 @@ TRACE_EVENT(powernv_throttle, TP_fast_assign( __entry->chip_id = chip_id; - __assign_str(reason, reason); + __assign_str(reason); __entry->pmax = pmax; ), @@ -210,11 +210,10 @@ TRACE_EVENT(device_pm_callback_start, ), TP_fast_assign( - __assign_str(device, dev_name(dev)); - __assign_str(driver, dev_driver_string(dev)); - __assign_str(parent, - dev->parent ? dev_name(dev->parent) : "none"); - __assign_str(pm_ops, pm_ops ? pm_ops : "none "); + __assign_str(device); + __assign_str(driver); + __assign_str(parent); + __assign_str(pm_ops); __entry->event = event; ), @@ -236,8 +235,8 @@ TRACE_EVENT(device_pm_callback_end, ), TP_fast_assign( - __assign_str(device, dev_name(dev)); - __assign_str(driver, dev_driver_string(dev)); + __assign_str(device); + __assign_str(driver); __entry->error = error; ), @@ -279,7 +278,7 @@ DECLARE_EVENT_CLASS(wakeup_source, ), TP_fast_assign( - __assign_str(name, name); + __assign_str(name); __entry->state = state; ), @@ -318,7 +317,7 @@ DECLARE_EVENT_CLASS(clock, ), TP_fast_assign( - __assign_str(name, name); + __assign_str(name); __entry->state = state; __entry->cpu_id = cpu_id; ), @@ -364,7 +363,7 @@ DECLARE_EVENT_CLASS(power_domain, ), TP_fast_assign( - __assign_str(name, name); + __assign_str(name); __entry->state = state; __entry->cpu_id = cpu_id; ), @@ -486,7 +485,7 @@ DECLARE_EVENT_CLASS(dev_pm_qos_request, ), TP_fast_assign( - __assign_str(name, name); + __assign_str(name); __entry->type = type; __entry->new_value = new_value; ), diff --git a/include/trace/events/pwc.h b/include/trace/events/pwc.h index a2da764a3b..0543702542 100644 --- a/include/trace/events/pwc.h +++ b/include/trace/events/pwc.h @@ -26,7 +26,7 @@ TRACE_EVENT(pwc_handler_enter, __entry->urb__actual_length = urb->actual_length; __entry->fbuf__filled = (pdev->fill_buf ? pdev->fill_buf->filled : 0); - __assign_str(name, pdev->v4l2_dev.name); + __assign_str(name); ), TP_printk("dev=%s (fbuf=%p filled=%d) urb=%p (status=%d actual_length=%u)", __get_str(name), @@ -50,7 +50,7 @@ TRACE_EVENT(pwc_handler_exit, __entry->urb = urb; __entry->fbuf = pdev->fill_buf; __entry->fbuf__filled = pdev->fill_buf->filled; - __assign_str(name, pdev->v4l2_dev.name); + __assign_str(name); ), TP_printk(" dev=%s (fbuf=%p filled=%d) urb=%p", __get_str(name), diff --git a/include/trace/events/qdisc.h b/include/trace/events/qdisc.h index 061fd49603..ff33f41a9d 100644 --- a/include/trace/events/qdisc.h +++ b/include/trace/events/qdisc.h @@ -88,8 +88,8 @@ TRACE_EVENT(qdisc_reset, ), TP_fast_assign( - __assign_str(dev, qdisc_dev(q) ? qdisc_dev(q)->name : "(null)"); - __assign_str(kind, q->ops->id); + __assign_str(dev); + __assign_str(kind); __entry->parent = q->parent; __entry->handle = q->handle; ), @@ -113,8 +113,8 @@ TRACE_EVENT(qdisc_destroy, ), TP_fast_assign( - __assign_str(dev, qdisc_dev(q)->name); - __assign_str(kind, q->ops->id); + __assign_str(dev); + __assign_str(kind); __entry->parent = q->parent; __entry->handle = q->handle; ), @@ -137,8 +137,8 @@ TRACE_EVENT(qdisc_create, ), TP_fast_assign( - __assign_str(dev, dev->name); - __assign_str(kind, ops->id); + __assign_str(dev); + __assign_str(kind); __entry->parent = parent; ), diff --git a/include/trace/events/qla.h b/include/trace/events/qla.h index e7fd55e7dc..8800c35525 100644 --- a/include/trace/events/qla.h +++ b/include/trace/events/qla.h @@ -25,7 +25,7 @@ DECLARE_EVENT_CLASS(qla_log_event, __vstring(msg, vaf->fmt, vaf->va) ), TP_fast_assign( - __assign_str(buf, buf); + __assign_str(buf); __assign_vstr(msg, vaf->fmt, vaf->va); ), diff --git a/include/trace/events/qrtr.h b/include/trace/events/qrtr.h index 441132c671..14f8229837 100644 --- a/include/trace/events/qrtr.h +++ b/include/trace/events/qrtr.h @@ -102,7 +102,7 @@ TRACE_EVENT(qrtr_ns_message, ), TP_fast_assign( - __assign_str(ctrl_pkt_str, ctrl_pkt_str); + __assign_str(ctrl_pkt_str); __entry->sq_node = sq_node; __entry->sq_port = sq_port; ), diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h index 2ef9c71977..31b3e0d3e6 100644 --- a/include/trace/events/rcu.h +++ b/include/trace/events/rcu.h @@ -708,6 +708,33 @@ TRACE_EVENT_RCU(rcu_invoke_kfree_bulk_callback, ); /* + * Tracepoint for a normal synchronize_rcu() states. The first argument + * is the RCU flavor, the second argument is a pointer to rcu_head the + * last one is an event. + */ +TRACE_EVENT_RCU(rcu_sr_normal, + + TP_PROTO(const char *rcuname, struct rcu_head *rhp, const char *srevent), + + TP_ARGS(rcuname, rhp, srevent), + + TP_STRUCT__entry( + __field(const char *, rcuname) + __field(void *, rhp) + __field(const char *, srevent) + ), + + TP_fast_assign( + __entry->rcuname = rcuname; + __entry->rhp = rhp; + __entry->srevent = srevent; + ), + + TP_printk("%s rhp=0x%p event=%s", + __entry->rcuname, __entry->rhp, __entry->srevent) +); + +/* * Tracepoint for exiting rcu_do_batch after RCU callbacks have been * invoked. The first argument is the name of the RCU flavor, * the second argument is number of callbacks actually invoked, diff --git a/include/trace/events/regulator.h b/include/trace/events/regulator.h index 72b3ba93b0..c58481a5d9 100644 --- a/include/trace/events/regulator.h +++ b/include/trace/events/regulator.h @@ -23,7 +23,7 @@ DECLARE_EVENT_CLASS(regulator_basic, ), TP_fast_assign( - __assign_str(name, name); + __assign_str(name); ), TP_printk("name=%s", __get_str(name)) @@ -119,7 +119,7 @@ DECLARE_EVENT_CLASS(regulator_range, ), TP_fast_assign( - __assign_str(name, name); + __assign_str(name); __entry->min = min; __entry->max = max; ), @@ -152,7 +152,7 @@ DECLARE_EVENT_CLASS(regulator_value, ), TP_fast_assign( - __assign_str(name, name); + __assign_str(name); __entry->val = val; ), diff --git a/include/trace/events/rpcgss.h b/include/trace/events/rpcgss.h index f50fcafc69..b0b6300a0c 100644 --- a/include/trace/events/rpcgss.h +++ b/include/trace/events/rpcgss.h @@ -54,7 +54,7 @@ TRACE_DEFINE_ENUM(GSS_S_UNSEQ_TOKEN); TRACE_DEFINE_ENUM(GSS_S_GAP_TOKEN); #define show_gss_status(x) \ - __print_flags(x, "|", \ + __print_symbolic(x, \ { GSS_S_BAD_MECH, "GSS_S_BAD_MECH" }, \ { GSS_S_BAD_NAME, "GSS_S_BAD_NAME" }, \ { GSS_S_BAD_NAMETYPE, "GSS_S_BAD_NAMETYPE" }, \ @@ -154,7 +154,7 @@ DECLARE_EVENT_CLASS(rpcgss_ctx_class, TP_fast_assign( __entry->cred = gc; __entry->service = gc->gc_service; - __assign_str(principal, gc->gc_principal); + __assign_str(principal); ), TP_printk("cred=%p service=%s principal='%s'", @@ -189,7 +189,7 @@ DECLARE_EVENT_CLASS(rpcgss_svc_gssapi_class, TP_fast_assign( __entry->xid = __be32_to_cpu(rqstp->rq_xid); __entry->maj_stat = maj_stat; - __assign_str(addr, rqstp->rq_xprt->xpt_remotebuf); + __assign_str(addr); ), TP_printk("addr=%s xid=0x%08x maj_stat=%s", @@ -225,7 +225,7 @@ TRACE_EVENT(rpcgss_svc_wrap_failed, TP_fast_assign( __entry->xid = be32_to_cpu(rqstp->rq_xid); - __assign_str(addr, rqstp->rq_xprt->xpt_remotebuf); + __assign_str(addr); ), TP_printk("addr=%s xid=0x%08x", __get_str(addr), __entry->xid) @@ -245,7 +245,7 @@ TRACE_EVENT(rpcgss_svc_unwrap_failed, TP_fast_assign( __entry->xid = be32_to_cpu(rqstp->rq_xid); - __assign_str(addr, rqstp->rq_xprt->xpt_remotebuf); + __assign_str(addr); ), TP_printk("addr=%s xid=0x%08x", __get_str(addr), __entry->xid) @@ -271,7 +271,7 @@ TRACE_EVENT(rpcgss_svc_seqno_bad, __entry->expected = expected; __entry->received = received; __entry->xid = __be32_to_cpu(rqstp->rq_xid); - __assign_str(addr, rqstp->rq_xprt->xpt_remotebuf); + __assign_str(addr); ), TP_printk("addr=%s xid=0x%08x expected seqno %u, received seqno %u", @@ -299,7 +299,7 @@ TRACE_EVENT(rpcgss_svc_accept_upcall, __entry->minor_status = minor_status; __entry->major_status = major_status; __entry->xid = be32_to_cpu(rqstp->rq_xid); - __assign_str(addr, rqstp->rq_xprt->xpt_remotebuf); + __assign_str(addr); ), TP_printk("addr=%s xid=0x%08x major_status=%s (0x%08lx) minor_status=%u", @@ -327,7 +327,7 @@ TRACE_EVENT(rpcgss_svc_authenticate, TP_fast_assign( __entry->xid = be32_to_cpu(rqstp->rq_xid); __entry->seqno = gc->gc_seq; - __assign_str(addr, rqstp->rq_xprt->xpt_remotebuf); + __assign_str(addr); ), TP_printk("addr=%s xid=0x%08x seqno=%u", __get_str(addr), @@ -563,7 +563,7 @@ TRACE_EVENT(rpcgss_upcall_msg, ), TP_fast_assign( - __assign_str(msg, buf); + __assign_str(msg); ), TP_printk("msg='%s'", __get_str(msg)) @@ -618,7 +618,7 @@ TRACE_EVENT(rpcgss_context, __entry->timeout = timeout; __entry->window_size = window_size; __entry->len = len; - __assign_str(acceptor, data); + __assign_str(acceptor); ), TP_printk("win_size=%u expiry=%lu now=%lu timeout=%u acceptor=%.*s", @@ -677,7 +677,7 @@ TRACE_EVENT(rpcgss_oid_to_mech, ), TP_fast_assign( - __assign_str(oid, oid); + __assign_str(oid); ), TP_printk("mech for oid %s was not found", __get_str(oid)) diff --git a/include/trace/events/rpcrdma.h b/include/trace/events/rpcrdma.h index 027ac3ab45..1439265227 100644 --- a/include/trace/events/rpcrdma.h +++ b/include/trace/events/rpcrdma.h @@ -304,8 +304,8 @@ DECLARE_EVENT_CLASS(xprtrdma_reply_class, __entry->xid = be32_to_cpu(rep->rr_xid); __entry->version = be32_to_cpu(rep->rr_vers); __entry->proc = be32_to_cpu(rep->rr_proc); - __assign_str(addr, rpcrdma_addrstr(rep->rr_rxprt)); - __assign_str(port, rpcrdma_portstr(rep->rr_rxprt)); + __assign_str(addr); + __assign_str(port); ), TP_printk("peer=[%s]:%s xid=0x%08x version=%u proc=%u", @@ -335,8 +335,8 @@ DECLARE_EVENT_CLASS(xprtrdma_rxprt, ), TP_fast_assign( - __assign_str(addr, rpcrdma_addrstr(r_xprt)); - __assign_str(port, rpcrdma_portstr(r_xprt)); + __assign_str(addr); + __assign_str(port); ), TP_printk("peer=[%s]:%s", @@ -369,8 +369,8 @@ DECLARE_EVENT_CLASS(xprtrdma_connect_class, TP_fast_assign( __entry->rc = rc; __entry->connect_status = r_xprt->rx_ep->re_connect_status; - __assign_str(addr, rpcrdma_addrstr(r_xprt)); - __assign_str(port, rpcrdma_portstr(r_xprt)); + __assign_str(addr); + __assign_str(port); ), TP_printk("peer=[%s]:%s rc=%d connection status=%d", @@ -608,8 +608,8 @@ DECLARE_EVENT_CLASS(xprtrdma_callback_class, TP_fast_assign( __entry->xid = be32_to_cpu(rqst->rq_xid); - __assign_str(addr, rpcrdma_addrstr(r_xprt)); - __assign_str(port, rpcrdma_portstr(r_xprt)); + __assign_str(addr); + __assign_str(port); ), TP_printk("peer=[%s]:%s xid=0x%08x", @@ -687,8 +687,8 @@ TRACE_EVENT(xprtrdma_op_connect, TP_fast_assign( __entry->delay = delay; - __assign_str(addr, rpcrdma_addrstr(r_xprt)); - __assign_str(port, rpcrdma_portstr(r_xprt)); + __assign_str(addr); + __assign_str(port); ), TP_printk("peer=[%s]:%s delay=%lu", @@ -716,8 +716,8 @@ TRACE_EVENT(xprtrdma_op_set_cto, TP_fast_assign( __entry->connect = connect; __entry->reconnect = reconnect; - __assign_str(addr, rpcrdma_addrstr(r_xprt)); - __assign_str(port, rpcrdma_portstr(r_xprt)); + __assign_str(addr); + __assign_str(port); ), TP_printk("peer=[%s]:%s connect=%lu reconnect=%lu", @@ -746,8 +746,8 @@ TRACE_EVENT(xprtrdma_createmrs, TP_fast_assign( __entry->count = count; - __assign_str(addr, rpcrdma_addrstr(r_xprt)); - __assign_str(port, rpcrdma_portstr(r_xprt)); + __assign_str(addr); + __assign_str(port); ), TP_printk("peer=[%s]:%s created %u MRs", @@ -775,8 +775,8 @@ TRACE_EVENT(xprtrdma_nomrs_err, __entry->task_id = rqst->rq_task->tk_pid; __entry->client_id = rqst->rq_task->tk_client->cl_clid; - __assign_str(addr, rpcrdma_addrstr(r_xprt)); - __assign_str(port, rpcrdma_portstr(r_xprt)); + __assign_str(addr); + __assign_str(port); ), TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " peer=[%s]:%s", @@ -1001,8 +1001,8 @@ TRACE_EVENT(xprtrdma_post_recvs, __entry->cq_id = ep->re_attr.recv_cq->res.id; __entry->count = count; __entry->posted = ep->re_receive_count; - __assign_str(addr, rpcrdma_addrstr(r_xprt)); - __assign_str(port, rpcrdma_portstr(r_xprt)); + __assign_str(addr); + __assign_str(port); ), TP_printk("peer=[%s]:%s cq.id=%d %u new recvs, %d active", @@ -1031,8 +1031,8 @@ TRACE_EVENT(xprtrdma_post_recvs_err, __entry->cq_id = ep->re_attr.recv_cq->res.id; __entry->status = status; - __assign_str(addr, rpcrdma_addrstr(r_xprt)); - __assign_str(port, rpcrdma_portstr(r_xprt)); + __assign_str(addr); + __assign_str(port); ), TP_printk("peer=[%s]:%s cq.id=%d rc=%d", @@ -1445,8 +1445,8 @@ TRACE_EVENT(xprtrdma_cb_setup, TP_fast_assign( __entry->reqs = reqs; - __assign_str(addr, rpcrdma_addrstr(r_xprt)); - __assign_str(port, rpcrdma_portstr(r_xprt)); + __assign_str(addr); + __assign_str(port); ), TP_printk("peer=[%s]:%s %u reqs", @@ -1476,7 +1476,7 @@ DECLARE_EVENT_CLASS(svcrdma_accept_class, TP_fast_assign( __entry->status = status; - __assign_str(addr, rdma->sc_xprt.xpt_remotebuf); + __assign_str(addr); ), TP_printk("addr=%s status=%ld", @@ -1962,7 +1962,7 @@ TRACE_EVENT(svcrdma_send_err, TP_fast_assign( __entry->status = status; __entry->xid = __be32_to_cpu(rqst->rq_xid); - __assign_str(addr, rqst->rq_xprt->xpt_remotebuf); + __assign_str(addr); ), TP_printk("addr=%s xid=0x%08x status=%d", __get_str(addr), @@ -2025,7 +2025,7 @@ TRACE_EVENT(svcrdma_rq_post_err, TP_fast_assign( __entry->status = status; - __assign_str(addr, rdma->sc_xprt.xpt_remotebuf); + __assign_str(addr); ), TP_printk("addr=%s status=%d", @@ -2138,7 +2138,7 @@ TRACE_EVENT(svcrdma_qp_error, TP_fast_assign( __entry->event = event->event; - __assign_str(device, event->device->name); + __assign_str(device); snprintf(__entry->addr, sizeof(__entry->addr) - 1, "%pISpc", sap); ), diff --git a/include/trace/events/rpm.h b/include/trace/events/rpm.h index bd120e23ce..2b0b4b6ef8 100644 --- a/include/trace/events/rpm.h +++ b/include/trace/events/rpm.h @@ -33,7 +33,7 @@ DECLARE_EVENT_CLASS(rpm_internal, ), TP_fast_assign( - __assign_str(name, dev_name(dev)); + __assign_str(name); __entry->flags = flags; __entry->usage_count = atomic_read( &dev->power.usage_count); @@ -92,7 +92,7 @@ TRACE_EVENT(rpm_return_int, ), TP_fast_assign( - __assign_str(name, dev_name(dev)); + __assign_str(name); __entry->ip = ip; __entry->ret = ret; ), @@ -135,7 +135,7 @@ TRACE_EVENT(rpm_status, ), TP_fast_assign( - __assign_str(name, dev_name(dev)); + __assign_str(name); __entry->status = status; ), diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index dbb01b4b74..6df2b4685b 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -411,7 +411,7 @@ TRACE_EVENT(sched_process_exec, ), TP_fast_assign( - __assign_str(filename, bprm->filename); + __assign_str(filename); __entry->pid = p->pid; __entry->old_pid = old_pid; ), @@ -420,6 +420,41 @@ TRACE_EVENT(sched_process_exec, __entry->pid, __entry->old_pid) ); +/** + * sched_prepare_exec - called before setting up new exec + * @task: pointer to the current task + * @bprm: pointer to linux_binprm used for new exec + * + * Called before flushing the old exec, where @task is still unchanged, but at + * the point of no return during switching to the new exec. At the point it is + * called the exec will either succeed, or on failure terminate the task. Also + * see the "sched_process_exec" tracepoint, which is called right after @task + * has successfully switched to the new exec. + */ +TRACE_EVENT(sched_prepare_exec, + + TP_PROTO(struct task_struct *task, struct linux_binprm *bprm), + + TP_ARGS(task, bprm), + + TP_STRUCT__entry( + __string( interp, bprm->interp ) + __string( filename, bprm->filename ) + __field( pid_t, pid ) + __string( comm, task->comm ) + ), + + TP_fast_assign( + __assign_str(interp); + __assign_str(filename); + __entry->pid = task->pid; + __assign_str(comm); + ), + + TP_printk("interp=%s filename=%s pid=%d comm=%s", + __get_str(interp), __get_str(filename), + __entry->pid, __get_str(comm)) +); #ifdef CONFIG_SCHEDSTATS #define DEFINE_EVENT_SCHEDSTAT DEFINE_EVENT @@ -752,7 +787,7 @@ DECLARE_TRACE(pelt_dl_tp, TP_PROTO(struct rq *rq), TP_ARGS(rq)); -DECLARE_TRACE(pelt_thermal_tp, +DECLARE_TRACE(pelt_hw_tp, TP_PROTO(struct rq *rq), TP_ARGS(rq)); diff --git a/include/trace/events/scmi.h b/include/trace/events/scmi.h index 422c1ad948..1273004811 100644 --- a/include/trace/events/scmi.h +++ b/include/trace/events/scmi.h @@ -7,6 +7,8 @@ #include <linux/tracepoint.h> +#define TRACE_SCMI_MAX_TAG_LEN 6 + TRACE_EVENT(scmi_fc_call, TP_PROTO(u8 protocol_id, u8 msg_id, u32 res_id, u32 val1, u32 val2), TP_ARGS(protocol_id, msg_id, res_id, val1, val2), @@ -150,7 +152,7 @@ TRACE_EVENT(scmi_msg_dump, __field(u8, channel_id) __field(u8, protocol_id) __field(u8, msg_id) - __array(char, tag, 5) + __array(char, tag, TRACE_SCMI_MAX_TAG_LEN) __field(u16, seq) __field(int, status) __field(size_t, len) @@ -162,7 +164,7 @@ TRACE_EVENT(scmi_msg_dump, __entry->channel_id = channel_id; __entry->protocol_id = protocol_id; __entry->msg_id = msg_id; - strscpy(__entry->tag, tag, 5); + strscpy(__entry->tag, tag, TRACE_SCMI_MAX_TAG_LEN); __entry->seq = seq; __entry->status = status; __entry->len = len; diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h index fd206a6ab5..3836de435d 100644 --- a/include/trace/events/sock.h +++ b/include/trace/events/sock.h @@ -10,6 +10,7 @@ #include <linux/tracepoint.h> #include <linux/ipv6.h> #include <linux/tcp.h> +#include <trace/events/net_probe_common.h> #define family_names \ EM(AF_INET) \ @@ -109,7 +110,7 @@ TRACE_EVENT(sock_exceed_buf_limit, ), TP_fast_assign( - strncpy(__entry->name, prot->name, 32); + strscpy(__entry->name, prot->name, 32); __entry->sysctl_mem[0] = READ_ONCE(prot->sysctl_mem[0]); __entry->sysctl_mem[1] = READ_ONCE(prot->sysctl_mem[1]); __entry->sysctl_mem[2] = READ_ONCE(prot->sysctl_mem[2]); @@ -159,7 +160,6 @@ TRACE_EVENT(inet_sock_set_state, TP_fast_assign( const struct inet_sock *inet = inet_sk(sk); - struct in6_addr *pin6; __be32 *p32; __entry->skaddr = sk; @@ -177,20 +177,8 @@ TRACE_EVENT(inet_sock_set_state, p32 = (__be32 *) __entry->daddr; *p32 = inet->inet_daddr; -#if IS_ENABLED(CONFIG_IPV6) - if (sk->sk_family == AF_INET6) { - pin6 = (struct in6_addr *)__entry->saddr_v6; - *pin6 = sk->sk_v6_rcv_saddr; - pin6 = (struct in6_addr *)__entry->daddr_v6; - *pin6 = sk->sk_v6_daddr; - } else -#endif - { - pin6 = (struct in6_addr *)__entry->saddr_v6; - ipv6_addr_set_v4mapped(inet->inet_saddr, pin6); - pin6 = (struct in6_addr *)__entry->daddr_v6; - ipv6_addr_set_v4mapped(inet->inet_daddr, pin6); - } + TP_STORE_ADDRS(__entry, inet->inet_saddr, inet->inet_daddr, + sk->sk_v6_rcv_saddr, sk->sk_v6_daddr); ), TP_printk("family=%s protocol=%s sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c oldstate=%s newstate=%s", @@ -223,7 +211,6 @@ TRACE_EVENT(inet_sk_error_report, TP_fast_assign( const struct inet_sock *inet = inet_sk(sk); - struct in6_addr *pin6; __be32 *p32; __entry->error = sk->sk_err; @@ -238,20 +225,8 @@ TRACE_EVENT(inet_sk_error_report, p32 = (__be32 *) __entry->daddr; *p32 = inet->inet_daddr; -#if IS_ENABLED(CONFIG_IPV6) - if (sk->sk_family == AF_INET6) { - pin6 = (struct in6_addr *)__entry->saddr_v6; - *pin6 = sk->sk_v6_rcv_saddr; - pin6 = (struct in6_addr *)__entry->daddr_v6; - *pin6 = sk->sk_v6_daddr; - } else -#endif - { - pin6 = (struct in6_addr *)__entry->saddr_v6; - ipv6_addr_set_v4mapped(inet->inet_saddr, pin6); - pin6 = (struct in6_addr *)__entry->daddr_v6; - ipv6_addr_set_v4mapped(inet->inet_daddr, pin6); - } + TP_STORE_ADDRS(__entry, inet->inet_saddr, inet->inet_daddr, + sk->sk_v6_rcv_saddr, sk->sk_v6_daddr); ), TP_printk("family=%s protocol=%s sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c error=%d", diff --git a/include/trace/events/sof.h b/include/trace/events/sof.h index 21c2a1efb9..3061423c06 100644 --- a/include/trace/events/sof.h +++ b/include/trace/events/sof.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright(c) 2022 Intel Corporation. All rights reserved. + * Copyright(c) 2022 Intel Corporation * * Author: Noah Klayman <noah.klayman@intel.com> */ @@ -23,7 +23,7 @@ DECLARE_EVENT_CLASS(sof_widget_template, __field(int, use_count) ), TP_fast_assign( - __assign_str(name, swidget->widget->name); + __assign_str(name); __entry->use_count = swidget->use_count; ), TP_printk("name=%s use_count=%d", __get_str(name), __entry->use_count) @@ -49,7 +49,7 @@ TRACE_EVENT(sof_ipc3_period_elapsed_position, __field(u64, wallclock) ), TP_fast_assign( - __assign_str(device_name, dev_name(sdev->dev)); + __assign_str(device_name); __entry->host_posn = posn->host_posn; __entry->dai_posn = posn->dai_posn; __entry->wallclock = posn->wallclock; @@ -75,7 +75,7 @@ TRACE_EVENT(sof_pcm_pointer_position, __field(unsigned long, dai_posn) ), TP_fast_assign( - __assign_str(device_name, dev_name(sdev->dev)); + __assign_str(device_name); __entry->pcm_id = le32_to_cpu(spcm->pcm.pcm_id); __entry->stream = substream->stream; __entry->dma_posn = dma_posn; @@ -93,7 +93,7 @@ TRACE_EVENT(sof_stream_position_ipc_rx, __string(device_name, dev_name(dev)) ), TP_fast_assign( - __assign_str(device_name, dev_name(dev)); + __assign_str(device_name); ), TP_printk("device_name=%s", __get_str(device_name)) ); @@ -107,8 +107,8 @@ TRACE_EVENT(sof_ipc4_fw_config, __field(u32, value) ), TP_fast_assign( - __assign_str(device_name, dev_name(sdev->dev)); - __assign_str(key, key); + __assign_str(device_name); + __assign_str(key); __entry->value = value; ), TP_printk("device_name=%s key=%s value=%d", diff --git a/include/trace/events/sof_intel.h b/include/trace/events/sof_intel.h index 2a77f9d26c..9e579e57b1 100644 --- a/include/trace/events/sof_intel.h +++ b/include/trace/events/sof_intel.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright(c) 2022 Intel Corporation. All rights reserved. + * Copyright(c) 2022 Intel Corporation * * Author: Noah Klayman <noah.klayman@intel.com> */ @@ -22,8 +22,8 @@ TRACE_EVENT(sof_intel_hda_irq, __string(source, source) ), TP_fast_assign( - __assign_str(device_name, dev_name(sdev->dev)); - __assign_str(source, source); + __assign_str(device_name); + __assign_str(source); ), TP_printk("device_name=%s source=%s", __get_str(device_name), __get_str(source)) @@ -38,7 +38,7 @@ DECLARE_EVENT_CLASS(sof_intel_ipc_firmware_template, __field(u32, msg_ext) ), TP_fast_assign( - __assign_str(device_name, dev_name(sdev->dev)); + __assign_str(device_name); __entry->msg = msg; __entry->msg_ext = msg_ext; ), @@ -64,7 +64,7 @@ TRACE_EVENT(sof_intel_D0I3C_updated, __field(u8, reg) ), TP_fast_assign( - __assign_str(device_name, dev_name(sdev->dev)); + __assign_str(device_name); __entry->reg = reg; ), TP_printk("device_name=%s register=%#x", @@ -79,7 +79,7 @@ TRACE_EVENT(sof_intel_hda_irq_ipc_check, __field(u32, irq_status) ), TP_fast_assign( - __assign_str(device_name, dev_name(sdev->dev)); + __assign_str(device_name); __entry->irq_status = irq_status; ), TP_printk("device_name=%s irq_status=%#x", @@ -100,7 +100,7 @@ TRACE_EVENT(sof_intel_hda_dsp_pcm, __field(unsigned long, pos) ), TP_fast_assign( - __assign_str(device_name, dev_name(sdev->dev)); + __assign_str(device_name); __entry->hstream_index = hstream->index; __entry->substream = substream->stream; __entry->pos = pos; @@ -119,7 +119,7 @@ TRACE_EVENT(sof_intel_hda_dsp_stream_status, __field(u32, status) ), TP_fast_assign( - __assign_str(device_name, dev_name(dev)); + __assign_str(device_name); __entry->stream = s->index; __entry->status = status; ), @@ -135,7 +135,7 @@ TRACE_EVENT(sof_intel_hda_dsp_check_stream_irq, __field(u32, status) ), TP_fast_assign( - __assign_str(device_name, dev_name(sdev->dev)); + __assign_str(device_name); __entry->status = status; ), TP_printk("device_name=%s status=%#x", diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h index ac05ed06a0..5e84952166 100644 --- a/include/trace/events/sunrpc.h +++ b/include/trace/events/sunrpc.h @@ -188,10 +188,10 @@ TRACE_EVENT(rpc_clnt_new, __entry->client_id = clnt->cl_clid; __entry->xprtsec = args->xprtsec.policy; __entry->flags = args->flags; - __assign_str(program, clnt->cl_program->name); - __assign_str(server, xprt->servername); - __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]); - __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); + __assign_str(program); + __assign_str(server); + __assign_str(addr); + __assign_str(port); ), TP_printk("client=" SUNRPC_TRACE_CLID_SPECIFIER " peer=[%s]:%s" @@ -220,8 +220,8 @@ TRACE_EVENT(rpc_clnt_new_err, TP_fast_assign( __entry->error = error; - __assign_str(program, program); - __assign_str(server, server); + __assign_str(program); + __assign_str(server); ), TP_printk("program=%s server=%s error=%d", @@ -325,8 +325,8 @@ TRACE_EVENT(rpc_request, __entry->client_id = task->tk_client->cl_clid; __entry->version = task->tk_client->cl_vers; __entry->async = RPC_IS_ASYNC(task); - __assign_str(progname, task->tk_client->cl_program->name); - __assign_str(procname, rpc_proc_name(task)); + __assign_str(progname); + __assign_str(procname); ), TP_printk(SUNRPC_TRACE_TASK_SPECIFIER " %sv%d %s (%ssync)", @@ -439,7 +439,7 @@ DECLARE_EVENT_CLASS(rpc_task_queued, __entry->runstate = task->tk_runstate; __entry->status = task->tk_status; __entry->flags = task->tk_flags; - __assign_str(q_name, rpc_qname(q)); + __assign_str(q_name); ), TP_printk(SUNRPC_TRACE_TASK_SPECIFIER @@ -515,10 +515,10 @@ DECLARE_EVENT_CLASS(rpc_reply_event, __entry->task_id = task->tk_pid; __entry->client_id = task->tk_client->cl_clid; __entry->xid = be32_to_cpu(task->tk_rqstp->rq_xid); - __assign_str(progname, task->tk_client->cl_program->name); + __assign_str(progname); __entry->version = task->tk_client->cl_vers; - __assign_str(procname, rpc_proc_name(task)); - __assign_str(servername, task->tk_xprt->servername); + __assign_str(procname); + __assign_str(servername); ), TP_printk(SUNRPC_TRACE_TASK_SPECIFIER @@ -647,8 +647,8 @@ TRACE_EVENT(rpc_stats_latency, __entry->task_id = task->tk_pid; __entry->xid = be32_to_cpu(task->tk_rqstp->rq_xid); __entry->version = task->tk_client->cl_vers; - __assign_str(progname, task->tk_client->cl_program->name); - __assign_str(procname, rpc_proc_name(task)); + __assign_str(progname); + __assign_str(procname); __entry->backlog = ktime_to_us(backlog); __entry->rtt = ktime_to_us(rtt); __entry->execute = ktime_to_us(execute); @@ -697,16 +697,15 @@ TRACE_EVENT(rpc_xdr_overflow, __entry->task_id = task->tk_pid; __entry->client_id = task->tk_client->cl_clid; - __assign_str(progname, - task->tk_client->cl_program->name); + __assign_str(progname); __entry->version = task->tk_client->cl_vers; - __assign_str(procedure, task->tk_msg.rpc_proc->p_name); + __assign_str(procedure); } else { __entry->task_id = -1; __entry->client_id = -1; - __assign_str(progname, "unknown"); + __assign_str(progname); __entry->version = 0; - __assign_str(procedure, "unknown"); + __assign_str(procedure); } __entry->requested = requested; __entry->end = xdr->end; @@ -763,10 +762,9 @@ TRACE_EVENT(rpc_xdr_alignment, __entry->task_id = task->tk_pid; __entry->client_id = task->tk_client->cl_clid; - __assign_str(progname, - task->tk_client->cl_program->name); + __assign_str(progname); __entry->version = task->tk_client->cl_vers; - __assign_str(procedure, task->tk_msg.rpc_proc->p_name); + __assign_str(procedure); __entry->offset = offset; __entry->copied = copied; @@ -1018,8 +1016,8 @@ DECLARE_EVENT_CLASS(rpc_xprt_lifetime_class, TP_fast_assign( __entry->state = xprt->state; - __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]); - __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); + __assign_str(addr); + __assign_str(port); ), TP_printk("peer=[%s]:%s state=%s", @@ -1061,8 +1059,8 @@ DECLARE_EVENT_CLASS(rpc_xprt_event, TP_fast_assign( __entry->xid = be32_to_cpu(xid); __entry->status = status; - __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]); - __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); + __assign_str(addr); + __assign_str(port); ), TP_printk("peer=[%s]:%s xid=0x%08x status=%d", __get_str(addr), @@ -1140,10 +1138,9 @@ TRACE_EVENT(xprt_retransmit, __entry->xid = be32_to_cpu(rqst->rq_xid); __entry->ntrans = rqst->rq_ntrans; __entry->timeout = task->tk_timeout; - __assign_str(progname, - task->tk_client->cl_program->name); + __assign_str(progname); __entry->version = task->tk_client->cl_vers; - __assign_str(procname, rpc_proc_name(task)); + __assign_str(procname); ), TP_printk(SUNRPC_TRACE_TASK_SPECIFIER @@ -1167,8 +1164,8 @@ TRACE_EVENT(xprt_ping, TP_fast_assign( __entry->status = status; - __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]); - __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); + __assign_str(addr); + __assign_str(port); ), TP_printk("peer=[%s]:%s status=%d", @@ -1315,8 +1312,8 @@ TRACE_EVENT(xs_data_ready, ), TP_fast_assign( - __assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]); - __assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]); + __assign_str(addr); + __assign_str(port); ), TP_printk("peer=[%s]:%s", __get_str(addr), __get_str(port)) @@ -1339,10 +1336,8 @@ TRACE_EVENT(xs_stream_read_data, TP_fast_assign( __entry->err = err; __entry->total = total; - __assign_str(addr, xprt ? - xprt->address_strings[RPC_DISPLAY_ADDR] : EVENT_NULL_STR); - __assign_str(port, xprt ? - xprt->address_strings[RPC_DISPLAY_PORT] : EVENT_NULL_STR); + __assign_str(addr); + __assign_str(port); ), TP_printk("peer=[%s]:%s err=%zd total=%zu", __get_str(addr), @@ -1364,8 +1359,8 @@ TRACE_EVENT(xs_stream_read_request, ), TP_fast_assign( - __assign_str(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR]); - __assign_str(port, xs->xprt.address_strings[RPC_DISPLAY_PORT]); + __assign_str(addr); + __assign_str(port); __entry->xid = be32_to_cpu(xs->recv.xid); __entry->copied = xs->recv.copied; __entry->reclen = xs->recv.len; @@ -1403,7 +1398,7 @@ TRACE_EVENT(rpcb_getport, __entry->version = clnt->cl_vers; __entry->protocol = task->tk_xprt->prot; __entry->bind_version = bind_version; - __assign_str(servername, task->tk_xprt->servername); + __assign_str(servername); ), TP_printk(SUNRPC_TRACE_TASK_SPECIFIER @@ -1493,8 +1488,8 @@ TRACE_EVENT(rpcb_register, TP_fast_assign( __entry->program = program; __entry->version = version; - __assign_str(addr, addr); - __assign_str(netid, netid); + __assign_str(addr); + __assign_str(netid); ), TP_printk("program=%u version=%u addr=%s netid=%s", @@ -1521,7 +1516,7 @@ TRACE_EVENT(rpcb_unregister, TP_fast_assign( __entry->program = program; __entry->version = version; - __assign_str(netid, netid); + __assign_str(netid); ), TP_printk("program=%u version=%u netid=%s", @@ -1551,8 +1546,8 @@ DECLARE_EVENT_CLASS(rpc_tls_class, TP_fast_assign( __entry->requested_policy = clnt->cl_xprtsec.policy; __entry->version = clnt->cl_vers; - __assign_str(servername, xprt->servername); - __assign_str(progname, clnt->cl_program->name) + __assign_str(servername); + __assign_str(progname); ), TP_printk("server=%s %sv%u requested_policy=%s", @@ -1794,10 +1789,9 @@ TRACE_EVENT(svc_process, __entry->xid = be32_to_cpu(rqst->rq_xid); __entry->vers = rqst->rq_vers; __entry->proc = rqst->rq_proc; - __assign_str(service, name); - __assign_str(procedure, svc_proc_name(rqst)); - __assign_str(addr, rqst->rq_xprt ? - rqst->rq_xprt->xpt_remotebuf : EVENT_NULL_STR); + __assign_str(service); + __assign_str(procedure); + __assign_str(addr); ), TP_printk("addr=%s xid=0x%08x service=%s vers=%u proc=%s", @@ -1915,7 +1909,7 @@ TRACE_EVENT(svc_stats_latency, __entry->execute = ktime_to_us(ktime_sub(ktime_get(), rqst->rq_stime)); - __assign_str(procedure, svc_proc_name(rqst)); + __assign_str(procedure); ), TP_printk(SVC_RQST_ENDPOINT_FORMAT " proc=%s execute-us=%lu", @@ -1980,8 +1974,8 @@ TRACE_EVENT(svc_xprt_create_err, TP_fast_assign( __entry->error = PTR_ERR(xprt); - __assign_str(program, program); - __assign_str(protocol, protocol); + __assign_str(program); + __assign_str(protocol); __assign_sockaddr(addr, sap, salen); ), @@ -2120,8 +2114,8 @@ TRACE_EVENT(svc_xprt_accept, TP_fast_assign( SVC_XPRT_ENDPOINT_ASSIGNMENTS(xprt); - __assign_str(protocol, xprt->xpt_class->xcl_name); - __assign_str(service, service); + __assign_str(protocol); + __assign_str(service); ), TP_printk(SVC_XPRT_ENDPOINT_FORMAT " protocol=%s service=%s", @@ -2260,7 +2254,7 @@ TRACE_EVENT(svcsock_marker, TP_fast_assign( __entry->length = be32_to_cpu(marker) & RPC_FRAGMENT_SIZE_MASK; __entry->last = be32_to_cpu(marker) & RPC_LAST_STREAM_FRAGMENT; - __assign_str(addr, xprt->xpt_remotebuf); + __assign_str(addr); ), TP_printk("addr=%s length=%u%s", __get_str(addr), @@ -2284,7 +2278,7 @@ DECLARE_EVENT_CLASS(svcsock_class, TP_fast_assign( __entry->result = result; __entry->flags = xprt->xpt_flags; - __assign_str(addr, xprt->xpt_remotebuf); + __assign_str(addr); ), TP_printk("addr=%s result=%zd flags=%s", __get_str(addr), @@ -2330,7 +2324,7 @@ TRACE_EVENT(svcsock_tcp_recv_short, __entry->expected = expected; __entry->received = received; __entry->flags = xprt->xpt_flags; - __assign_str(addr, xprt->xpt_remotebuf); + __assign_str(addr); ), TP_printk("addr=%s flags=%s expected=%u received=%u", @@ -2358,7 +2352,7 @@ TRACE_EVENT(svcsock_tcp_state, __entry->socket_state = socket->state; __entry->sock_state = socket->sk->sk_state; __entry->flags = xprt->xpt_flags; - __assign_str(addr, xprt->xpt_remotebuf); + __assign_str(addr); ), TP_printk("addr=%s state=%s sk_state=%s flags=%s", __get_str(addr), @@ -2385,7 +2379,7 @@ DECLARE_EVENT_CLASS(svcsock_accept_class, TP_fast_assign( __entry->status = status; - __assign_str(service, service); + __assign_str(service); __entry->netns_ino = xprt->xpt_net->ns.inum; ), @@ -2421,7 +2415,7 @@ DECLARE_EVENT_CLASS(cache_event, TP_fast_assign( __entry->h = h; - __assign_str(name, cd->name); + __assign_str(name); ), TP_printk("cache=%s entry=%p", __get_str(name), __entry->h) @@ -2466,7 +2460,7 @@ DECLARE_EVENT_CLASS(register_class, __entry->protocol = protocol; __entry->port = port; __entry->error = error; - __assign_str(program, program); + __assign_str(program); ), TP_printk("program=%sv%u proto=%s port=%u family=%s error=%d", @@ -2511,7 +2505,7 @@ TRACE_EVENT(svc_unregister, TP_fast_assign( __entry->version = version; __entry->error = error; - __assign_str(program, program); + __assign_str(program); ), TP_printk("program=%sv%u error=%d", diff --git a/include/trace/events/swiotlb.h b/include/trace/events/swiotlb.h index da05c9ebd2..3b6ddb136e 100644 --- a/include/trace/events/swiotlb.h +++ b/include/trace/events/swiotlb.h @@ -20,7 +20,7 @@ TRACE_EVENT(swiotlb_bounced, ), TP_fast_assign( - __assign_str(dev_name, dev_name(dev)); + __assign_str(dev_name); __entry->dma_mask = (dev->dma_mask ? *dev->dma_mask : 0); __entry->dev_addr = dev_addr; __entry->size = size; diff --git a/include/trace/events/target.h b/include/trace/events/target.h index 67fad2677e..a13cbf2b34 100644 --- a/include/trace/events/target.h +++ b/include/trace/events/target.h @@ -154,7 +154,7 @@ TRACE_EVENT(target_sequencer_start, __entry->task_attribute = cmd->sam_task_attr; __entry->control = scsi_command_control(cmd->t_task_cdb); memcpy(__entry->cdb, cmd->t_task_cdb, TCM_MAX_COMMAND_SIZE); - __assign_str(initiator, cmd->se_sess->se_node_acl->initiatorname); + __assign_str(initiator); ), TP_printk("%s -> LUN %03u tag %#llx %s data_length %6u CDB %s (TA:%s C:%02x)", @@ -198,7 +198,7 @@ TRACE_EVENT(target_cmd_complete, min(18, ((u8 *) cmd->sense_buffer)[SPC_ADD_SENSE_LEN_OFFSET] + 8) : 0; memcpy(__entry->cdb, cmd->t_task_cdb, TCM_MAX_COMMAND_SIZE); memcpy(__entry->sense_data, cmd->sense_buffer, __entry->sense_length); - __assign_str(initiator, cmd->se_sess->se_node_acl->initiatorname); + __assign_str(initiator); ), TP_printk("%s <- LUN %03u tag %#llx status %s (sense len %d%s%s) %s data_length %6u CDB %s (TA:%s C:%02x)", diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h index 699dafd204..49b5ee091c 100644 --- a/include/trace/events/tcp.h +++ b/include/trace/events/tcp.h @@ -11,35 +11,7 @@ #include <net/ipv6.h> #include <net/tcp.h> #include <linux/sock_diag.h> - -#define TP_STORE_V4MAPPED(__entry, saddr, daddr) \ - do { \ - struct in6_addr *pin6; \ - \ - pin6 = (struct in6_addr *)__entry->saddr_v6; \ - ipv6_addr_set_v4mapped(saddr, pin6); \ - pin6 = (struct in6_addr *)__entry->daddr_v6; \ - ipv6_addr_set_v4mapped(daddr, pin6); \ - } while (0) - -#if IS_ENABLED(CONFIG_IPV6) -#define TP_STORE_ADDRS(__entry, saddr, daddr, saddr6, daddr6) \ - do { \ - if (sk->sk_family == AF_INET6) { \ - struct in6_addr *pin6; \ - \ - pin6 = (struct in6_addr *)__entry->saddr_v6; \ - *pin6 = saddr6; \ - pin6 = (struct in6_addr *)__entry->daddr_v6; \ - *pin6 = daddr6; \ - } else { \ - TP_STORE_V4MAPPED(__entry, saddr, daddr); \ - } \ - } while (0) -#else -#define TP_STORE_ADDRS(__entry, saddr, daddr, saddr6, daddr6) \ - TP_STORE_V4MAPPED(__entry, saddr, daddr) -#endif +#include <net/rstreason.h> /* * tcp event with arguments sk and skb @@ -103,17 +75,70 @@ DEFINE_EVENT(tcp_event_sk_skb, tcp_retransmit_skb, TP_ARGS(sk, skb) ); +#undef FN +#define FN(reason) TRACE_DEFINE_ENUM(SK_RST_REASON_##reason); +DEFINE_RST_REASON(FN, FN) + +#undef FN +#undef FNe +#define FN(reason) { SK_RST_REASON_##reason, #reason }, +#define FNe(reason) { SK_RST_REASON_##reason, #reason } + /* * skb of trace_tcp_send_reset is the skb that caused RST. In case of * active reset, skb should be NULL */ -DEFINE_EVENT(tcp_event_sk_skb, tcp_send_reset, +TRACE_EVENT(tcp_send_reset, - TP_PROTO(const struct sock *sk, const struct sk_buff *skb), + TP_PROTO(const struct sock *sk, + const struct sk_buff *skb, + const enum sk_rst_reason reason), - TP_ARGS(sk, skb) + TP_ARGS(sk, skb, reason), + + TP_STRUCT__entry( + __field(const void *, skbaddr) + __field(const void *, skaddr) + __field(int, state) + __field(enum sk_rst_reason, reason) + __array(__u8, saddr, sizeof(struct sockaddr_in6)) + __array(__u8, daddr, sizeof(struct sockaddr_in6)) + ), + + TP_fast_assign( + __entry->skbaddr = skb; + __entry->skaddr = sk; + /* Zero means unknown state. */ + __entry->state = sk ? sk->sk_state : 0; + + memset(__entry->saddr, 0, sizeof(struct sockaddr_in6)); + memset(__entry->daddr, 0, sizeof(struct sockaddr_in6)); + + if (sk && sk_fullsock(sk)) { + const struct inet_sock *inet = inet_sk(sk); + + TP_STORE_ADDR_PORTS(__entry, inet, sk); + } else if (skb) { + const struct tcphdr *th = (const struct tcphdr *)skb->data; + /* + * We should reverse the 4-tuple of skb, so later + * it can print the right flow direction of rst. + */ + TP_STORE_ADDR_PORTS_SKB(skb, th, entry->daddr, entry->saddr); + } + __entry->reason = reason; + ), + + TP_printk("skbaddr=%p skaddr=%p src=%pISpc dest=%pISpc state=%s reason=%s", + __entry->skbaddr, __entry->skaddr, + __entry->saddr, __entry->daddr, + __entry->state ? show_tcp_state_name(__entry->state) : "UNKNOWN", + __print_symbolic(__entry->reason, DEFINE_RST_REASON(FN, FNe))) ); +#undef FN +#undef FNe + /* * tcp event with arguments sk * @@ -302,48 +327,6 @@ TRACE_EVENT(tcp_probe, __entry->skbaddr, __entry->skaddr) ); -#define TP_STORE_ADDR_PORTS_SKB_V4(__entry, skb) \ - do { \ - const struct tcphdr *th = (const struct tcphdr *)skb->data; \ - struct sockaddr_in *v4 = (void *)__entry->saddr; \ - \ - v4->sin_family = AF_INET; \ - v4->sin_port = th->source; \ - v4->sin_addr.s_addr = ip_hdr(skb)->saddr; \ - v4 = (void *)__entry->daddr; \ - v4->sin_family = AF_INET; \ - v4->sin_port = th->dest; \ - v4->sin_addr.s_addr = ip_hdr(skb)->daddr; \ - } while (0) - -#if IS_ENABLED(CONFIG_IPV6) - -#define TP_STORE_ADDR_PORTS_SKB(__entry, skb) \ - do { \ - const struct iphdr *iph = ip_hdr(skb); \ - \ - if (iph->version == 6) { \ - const struct tcphdr *th = (const struct tcphdr *)skb->data; \ - struct sockaddr_in6 *v6 = (void *)__entry->saddr; \ - \ - v6->sin6_family = AF_INET6; \ - v6->sin6_port = th->source; \ - v6->sin6_addr = ipv6_hdr(skb)->saddr; \ - v6 = (void *)__entry->daddr; \ - v6->sin6_family = AF_INET6; \ - v6->sin6_port = th->dest; \ - v6->sin6_addr = ipv6_hdr(skb)->daddr; \ - } else \ - TP_STORE_ADDR_PORTS_SKB_V4(__entry, skb); \ - } while (0) - -#else - -#define TP_STORE_ADDR_PORTS_SKB(__entry, skb) \ - TP_STORE_ADDR_PORTS_SKB_V4(__entry, skb) - -#endif - /* * tcp event with only skb */ @@ -360,12 +343,13 @@ DECLARE_EVENT_CLASS(tcp_event_skb, ), TP_fast_assign( + const struct tcphdr *th = (const struct tcphdr *)skb->data; __entry->skbaddr = skb; memset(__entry->saddr, 0, sizeof(struct sockaddr_in6)); memset(__entry->daddr, 0, sizeof(struct sockaddr_in6)); - TP_STORE_ADDR_PORTS_SKB(__entry, skb); + TP_STORE_ADDR_PORTS_SKB(skb, th, __entry->saddr, __entry->daddr); ), TP_printk("skbaddr=%p src=%pISpc dest=%pISpc", diff --git a/include/trace/events/tegra_apb_dma.h b/include/trace/events/tegra_apb_dma.h index 971cd02d2d..6d9f5075ba 100644 --- a/include/trace/events/tegra_apb_dma.h +++ b/include/trace/events/tegra_apb_dma.h @@ -16,7 +16,7 @@ TRACE_EVENT(tegra_dma_tx_status, __field(__u32, residue) ), TP_fast_assign( - __assign_str(chan, dev_name(&dc->dev->device)); + __assign_str(chan); __entry->cookie = cookie; __entry->residue = state ? state->residue : (u32)-1; ), @@ -33,7 +33,7 @@ TRACE_EVENT(tegra_dma_complete_cb, __field(void *, ptr) ), TP_fast_assign( - __assign_str(chan, dev_name(&dc->dev->device)); + __assign_str(chan); __entry->count = count; __entry->ptr = ptr; ), @@ -49,7 +49,7 @@ TRACE_EVENT(tegra_dma_isr, __field(int, irq) ), TP_fast_assign( - __assign_str(chan, dev_name(&dc->dev->device)); + __assign_str(chan); __entry->irq = irq; ), TP_printk("%s: irq %d\n", __get_str(chan), __entry->irq) diff --git a/include/trace/events/udp.h b/include/trace/events/udp.h index 336fe27288..6142be4068 100644 --- a/include/trace/events/udp.h +++ b/include/trace/events/udp.h @@ -7,24 +7,43 @@ #include <linux/udp.h> #include <linux/tracepoint.h> +#include <trace/events/net_probe_common.h> TRACE_EVENT(udp_fail_queue_rcv_skb, - TP_PROTO(int rc, struct sock *sk), + TP_PROTO(int rc, struct sock *sk, struct sk_buff *skb), - TP_ARGS(rc, sk), + TP_ARGS(rc, sk, skb), TP_STRUCT__entry( __field(int, rc) - __field(__u16, lport) + + __field(__u16, sport) + __field(__u16, dport) + __field(__u16, family) + __array(__u8, saddr, sizeof(struct sockaddr_in6)) + __array(__u8, daddr, sizeof(struct sockaddr_in6)) ), TP_fast_assign( + const struct udphdr *uh = (const struct udphdr *)udp_hdr(skb); + __entry->rc = rc; - __entry->lport = inet_sk(sk)->inet_num; + + /* for filtering use */ + __entry->sport = ntohs(uh->source); + __entry->dport = ntohs(uh->dest); + __entry->family = sk->sk_family; + + memset(__entry->saddr, 0, sizeof(struct sockaddr_in6)); + memset(__entry->daddr, 0, sizeof(struct sockaddr_in6)); + + TP_STORE_ADDR_PORTS_SKB(skb, uh, __entry->saddr, __entry->daddr); ), - TP_printk("rc=%d port=%hu", __entry->rc, __entry->lport) + TP_printk("rc=%d family=%s src=%pISpc dest=%pISpc", __entry->rc, + show_family_name(__entry->family), + __entry->saddr, __entry->daddr) ); #endif /* _TRACE_UDP_H */ diff --git a/include/trace/events/ufs.h b/include/trace/events/ufs.h index b930669bd1..c4e209fbdf 100644 --- a/include/trace/events/ufs.h +++ b/include/trace/events/ufs.h @@ -92,7 +92,7 @@ TRACE_EVENT(ufshcd_clk_gating, ), TP_fast_assign( - __assign_str(dev_name, dev_name); + __assign_str(dev_name); __entry->state = state; ), @@ -117,9 +117,9 @@ TRACE_EVENT(ufshcd_clk_scaling, ), TP_fast_assign( - __assign_str(dev_name, dev_name); - __assign_str(state, state); - __assign_str(clk, clk); + __assign_str(dev_name); + __assign_str(state); + __assign_str(clk); __entry->prev_state = prev_state; __entry->curr_state = curr_state; ), @@ -141,8 +141,8 @@ TRACE_EVENT(ufshcd_auto_bkops_state, ), TP_fast_assign( - __assign_str(dev_name, dev_name); - __assign_str(state, state); + __assign_str(dev_name); + __assign_str(state); ), TP_printk("%s: auto bkops - %s", @@ -163,8 +163,8 @@ DECLARE_EVENT_CLASS(ufshcd_profiling_template, ), TP_fast_assign( - __assign_str(dev_name, dev_name); - __assign_str(profile_info, profile_info); + __assign_str(dev_name); + __assign_str(profile_info); __entry->time_us = time_us; __entry->err = err; ), @@ -206,7 +206,7 @@ DECLARE_EVENT_CLASS(ufshcd_template, TP_fast_assign( __entry->usecs = usecs; __entry->err = err; - __assign_str(dev_name, dev_name); + __assign_str(dev_name); __entry->dev_state = dev_state; __entry->link_state = link_state; ), @@ -326,7 +326,7 @@ TRACE_EVENT(ufshcd_uic_command, ), TP_fast_assign( - __assign_str(dev_name, dev_name); + __assign_str(dev_name); __entry->str_t = str_t; __entry->cmd = cmd; __entry->arg1 = arg1; @@ -356,7 +356,7 @@ TRACE_EVENT(ufshcd_upiu, ), TP_fast_assign( - __assign_str(dev_name, dev_name); + __assign_str(dev_name); __entry->str_t = str_t; memcpy(__entry->hdr, hdr, sizeof(__entry->hdr)); memcpy(__entry->tsf, tsf, sizeof(__entry->tsf)); @@ -384,7 +384,7 @@ TRACE_EVENT(ufshcd_exception_event, ), TP_fast_assign( - __assign_str(dev_name, dev_name); + __assign_str(dev_name); __entry->status = status; ), diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h index 262d52021c..b0de2bc9ed 100644 --- a/include/trace/events/workqueue.h +++ b/include/trace/events/workqueue.h @@ -38,7 +38,7 @@ TRACE_EVENT(workqueue_queue_work, TP_fast_assign( __entry->work = work; __entry->function = work->func; - __assign_str(workqueue, pwq->wq->name); + __assign_str(workqueue); __entry->req_cpu = req_cpu; __entry->cpu = pwq->pool->cpu; ), @@ -64,13 +64,15 @@ TRACE_EVENT(workqueue_activate_work, TP_STRUCT__entry( __field( void *, work ) + __field( void *, function) ), TP_fast_assign( __entry->work = work; + __entry->function = work->func; ), - TP_printk("work struct %p", __entry->work) + TP_printk("work struct %p function=%ps ", __entry->work, __entry->function) ); /** diff --git a/include/trace/events/xdp.h b/include/trace/events/xdp.h index 9adc2bdf2f..a7e5452b5d 100644 --- a/include/trace/events/xdp.h +++ b/include/trace/events/xdp.h @@ -416,7 +416,7 @@ TRACE_EVENT(bpf_xdp_link_attach_failed, ), TP_fast_assign( - __assign_str(msg, msg); + __assign_str(msg); ), TP_printk("errmsg=%s", __get_str(msg)) diff --git a/include/trace/misc/nfs.h b/include/trace/misc/nfs.h index e43e745915..7b221d5113 100644 --- a/include/trace/misc/nfs.h +++ b/include/trace/misc/nfs.h @@ -28,7 +28,6 @@ TRACE_DEFINE_ENUM(NFSERR_FBIG); TRACE_DEFINE_ENUM(NFSERR_NOSPC); TRACE_DEFINE_ENUM(NFSERR_ROFS); TRACE_DEFINE_ENUM(NFSERR_MLINK); -TRACE_DEFINE_ENUM(NFSERR_OPNOTSUPP); TRACE_DEFINE_ENUM(NFSERR_NAMETOOLONG); TRACE_DEFINE_ENUM(NFSERR_NOTEMPTY); TRACE_DEFINE_ENUM(NFSERR_DQUOT); @@ -64,7 +63,6 @@ TRACE_DEFINE_ENUM(NFSERR_JUKEBOX); { NFSERR_NOSPC, "NOSPC" }, \ { NFSERR_ROFS, "ROFS" }, \ { NFSERR_MLINK, "MLINK" }, \ - { NFSERR_OPNOTSUPP, "OPNOTSUPP" }, \ { NFSERR_NAMETOOLONG, "NAMETOOLONG" }, \ { NFSERR_NOTEMPTY, "NOTEMPTY" }, \ { NFSERR_DQUOT, "DQUOT" }, \ diff --git a/include/trace/stages/stage6_event_callback.h b/include/trace/stages/stage6_event_callback.h index 3690e67726..1691676fd8 100644 --- a/include/trace/stages/stage6_event_callback.h +++ b/include/trace/stages/stage6_event_callback.h @@ -31,12 +31,10 @@ #define __vstring(item, fmt, ap) __dynamic_array(char, item, -1) #undef __assign_str -#define __assign_str(dst, src) \ +#define __assign_str(dst) \ do { \ char *__str__ = __get_str(dst); \ int __len__ = __get_dynamic_array_len(dst) - 1; \ - WARN_ON_ONCE(!(void *)(src) != !(void *)__data_offsets.dst##_ptr_); \ - WARN_ON_ONCE((src) && strcmp((src), __data_offsets.dst##_ptr_)); \ memcpy(__str__, __data_offsets.dst##_ptr_ ? : \ EVENT_NULL_STR, __len__); \ __str__[__len__] = '\0'; \ |