1 /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
5 * Linux Trace Toolkit Next Generation Kernel State Dump
7 * Copyright 2005 Jean-Hugues Deschenes <jean-hugues.deschenes@polymtl.ca>
8 * Copyright 2006-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 * Eric Clement: Add listing of network IP interface
12 * 2006, 2007 Mathieu Desnoyers Fix kernel threads
16 #include <linux/init.h>
17 #include <linux/module.h>
18 #include <linux/netlink.h>
19 #include <linux/inet.h>
21 #include <linux/kthread.h>
22 #include <linux/proc_fs.h>
23 #include <linux/file.h>
24 #include <linux/interrupt.h>
25 #include <linux/irqnr.h>
26 #include <linux/netdevice.h>
27 #include <linux/inetdevice.h>
29 #include <linux/swap.h>
30 #include <linux/wait.h>
31 #include <linux/mutex.h>
32 #include <linux/device.h>
34 #include <linux/blkdev.h>
36 #include <lttng/events.h>
37 #include <lttng/tracer.h>
38 #include <lttng/events-internal.h>
39 #include <wrapper/cpu.h>
40 #include <wrapper/irqdesc.h>
41 #include <wrapper/fdtable.h>
42 #include <wrapper/namespace.h>
43 #include <wrapper/irq.h>
44 #include <wrapper/tracepoint.h>
45 #include <wrapper/genhd.h>
46 #include <wrapper/file.h>
47 #include <wrapper/fdtable.h>
48 #include <wrapper/sched.h>
50 #ifdef CONFIG_LTTNG_HAS_LIST_IRQ
51 #include <linux/irq.h>
54 /* Define the tracepoints, but do not build the probes */
55 #define CREATE_TRACE_POINTS
56 #define TRACE_INCLUDE_PATH instrumentation/events
57 #define TRACE_INCLUDE_FILE lttng-statedump
58 #define LTTNG_INSTRUMENTATION
59 #include <instrumentation/events/lttng-statedump.h>
61 LTTNG_DEFINE_TRACE(lttng_statedump_block_device
,
62 TP_PROTO(struct lttng_kernel_session
*session
,
63 dev_t dev
, const char *diskname
),
64 TP_ARGS(session
, dev
, diskname
));
66 LTTNG_DEFINE_TRACE(lttng_statedump_end
,
67 TP_PROTO(struct lttng_kernel_session
*session
),
70 LTTNG_DEFINE_TRACE(lttng_statedump_interrupt
,
71 TP_PROTO(struct lttng_kernel_session
*session
,
72 unsigned int irq
, const char *chip_name
,
73 struct irqaction
*action
),
74 TP_ARGS(session
, irq
, chip_name
, action
));
76 LTTNG_DEFINE_TRACE(lttng_statedump_file_descriptor
,
77 TP_PROTO(struct lttng_kernel_session
*session
,
78 struct files_struct
*files
,
79 int fd
, const char *filename
,
80 unsigned int flags
, fmode_t fmode
),
81 TP_ARGS(session
, files
, fd
, filename
, flags
, fmode
));
83 LTTNG_DEFINE_TRACE(lttng_statedump_start
,
84 TP_PROTO(struct lttng_kernel_session
*session
),
87 LTTNG_DEFINE_TRACE(lttng_statedump_process_state
,
88 TP_PROTO(struct lttng_kernel_session
*session
,
89 struct task_struct
*p
,
90 int type
, int mode
, int submode
, int status
,
91 struct files_struct
*files
),
92 TP_ARGS(session
, p
, type
, mode
, submode
, status
, files
));
94 LTTNG_DEFINE_TRACE(lttng_statedump_process_pid_ns
,
95 TP_PROTO(struct lttng_kernel_session
*session
,
96 struct task_struct
*p
,
97 struct pid_namespace
*pid_ns
),
98 TP_ARGS(session
, p
, pid_ns
));
100 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0))
101 LTTNG_DEFINE_TRACE(lttng_statedump_process_cgroup_ns
,
102 TP_PROTO(struct lttng_kernel_session
*session
,
103 struct task_struct
*p
,
104 struct cgroup_namespace
*cgroup_ns
),
105 TP_ARGS(session
, p
, cgroup_ns
));
108 LTTNG_DEFINE_TRACE(lttng_statedump_process_ipc_ns
,
109 TP_PROTO(struct lttng_kernel_session
*session
,
110 struct task_struct
*p
,
111 struct ipc_namespace
*ipc_ns
),
112 TP_ARGS(session
, p
, ipc_ns
));
114 #ifndef LTTNG_MNT_NS_MISSING_HEADER
115 LTTNG_DEFINE_TRACE(lttng_statedump_process_mnt_ns
,
116 TP_PROTO(struct lttng_kernel_session
*session
,
117 struct task_struct
*p
,
118 struct mnt_namespace
*mnt_ns
),
119 TP_ARGS(session
, p
, mnt_ns
));
122 LTTNG_DEFINE_TRACE(lttng_statedump_process_net_ns
,
123 TP_PROTO(struct lttng_kernel_session
*session
,
124 struct task_struct
*p
,
126 TP_ARGS(session
, p
, net_ns
));
128 LTTNG_DEFINE_TRACE(lttng_statedump_process_user_ns
,
129 TP_PROTO(struct lttng_kernel_session
*session
,
130 struct task_struct
*p
,
131 struct user_namespace
*user_ns
),
132 TP_ARGS(session
, p
, user_ns
));
134 LTTNG_DEFINE_TRACE(lttng_statedump_process_uts_ns
,
135 TP_PROTO(struct lttng_kernel_session
*session
,
136 struct task_struct
*p
,
137 struct uts_namespace
*uts_ns
),
138 TP_ARGS(session
, p
, uts_ns
));
140 LTTNG_DEFINE_TRACE(lttng_statedump_process_time_ns
,
141 TP_PROTO(struct lttng_kernel_session
*session
,
142 struct task_struct
*p
,
143 struct time_namespace
*time_ns
),
144 TP_ARGS(session
, p
, time_ns
));
146 LTTNG_DEFINE_TRACE(lttng_statedump_network_interface
,
147 TP_PROTO(struct lttng_kernel_session
*session
,
148 struct net_device
*dev
, struct in_ifaddr
*ifa
),
149 TP_ARGS(session
, dev
, ifa
));
151 #ifdef LTTNG_HAVE_STATEDUMP_CPU_TOPOLOGY
152 LTTNG_DEFINE_TRACE(lttng_statedump_cpu_topology
,
153 TP_PROTO(struct lttng_kernel_session
*session
, struct cpuinfo_x86
*c
),
154 TP_ARGS(session
, c
));
157 struct lttng_fd_ctx
{
159 struct lttng_kernel_session
*session
;
160 struct files_struct
*files
;
164 * Protected by the trace lock.
166 static struct delayed_work cpu_work
[NR_CPUS
];
167 static DECLARE_WAIT_QUEUE_HEAD(statedump_wq
);
168 static atomic_t kernel_threads_to_run
;
170 enum lttng_thread_type
{
171 LTTNG_USER_THREAD
= 0,
172 LTTNG_KERNEL_THREAD
= 1,
175 enum lttng_execution_mode
{
181 LTTNG_MODE_UNKNOWN
= 5,
184 enum lttng_execution_submode
{
189 enum lttng_process_status
{
201 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,0,0) || \
202 LTTNG_RHEL_KERNEL_RANGE(5,14,0,163,0,0, 5,15,0,0,0,0))
204 #define LTTNG_PART_STRUCT_TYPE struct block_device
207 int lttng_get_part_name(struct gendisk
*disk
, struct block_device
*part
, char *name_buf
)
211 ret
= snprintf(name_buf
, BDEVNAME_SIZE
, "%pg", part
);
212 if (ret
< 0 || ret
>= BDEVNAME_SIZE
)
219 dev_t
lttng_get_part_devt(struct block_device
*part
)
224 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0))
226 #define LTTNG_PART_STRUCT_TYPE struct block_device
229 int lttng_get_part_name(struct gendisk
*disk
, struct block_device
*part
, char *name_buf
)
233 p
= bdevname(part
, name_buf
);
241 dev_t
lttng_get_part_devt(struct block_device
*part
)
248 #define LTTNG_PART_STRUCT_TYPE struct hd_struct
251 int lttng_get_part_name(struct gendisk
*disk
, struct hd_struct
*part
, char *name_buf
)
254 struct block_device bdev
;
257 * Create a partial 'struct blockdevice' to use
258 * 'bdevname()' which is a simple wrapper over
259 * 'disk_name()' but has the honor to be EXPORT_SYMBOL.
264 p
= bdevname(&bdev
, name_buf
);
272 dev_t
lttng_get_part_devt(struct hd_struct
*part
)
274 return part_devt(part
);
278 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,12,0))
280 int lttng_statedump_each_block_device(struct lttng_kernel_session
*session
, struct gendisk
*disk
)
282 struct block_device
*part
;
286 /* Include partition 0 */
290 xa_for_each(&disk
->part_tbl
, idx
, part
) {
291 char name_buf
[BDEVNAME_SIZE
];
293 /* Exclude non-partitions bdev and empty partitions. */
294 if (bdev_is_partition(part
) && !bdev_nr_sectors(part
))
297 if (lttng_get_part_name(disk
, part
, name_buf
) == -ENOSYS
) {
301 trace_lttng_statedump_block_device(session
, lttng_get_part_devt(part
),
310 int lttng_statedump_each_block_device(struct lttng_kernel_session
*session
, struct gendisk
*disk
)
312 struct disk_part_iter piter
;
313 LTTNG_PART_STRUCT_TYPE
*part
;
315 disk_part_iter_init(&piter
, disk
, DISK_PITER_INCL_PART0
);
317 while ((part
= disk_part_iter_next(&piter
))) {
318 char name_buf
[BDEVNAME_SIZE
];
320 if (lttng_get_part_name(disk
, part
, name_buf
) == -ENOSYS
) {
321 disk_part_iter_exit(&piter
);
324 trace_lttng_statedump_block_device(session
, lttng_get_part_devt(part
),
327 disk_part_iter_exit(&piter
);
334 int lttng_enumerate_block_devices(struct lttng_kernel_session
*session
)
336 struct class *ptr_block_class
;
337 struct device_type
*ptr_disk_type
;
338 struct class_dev_iter iter
;
342 ptr_block_class
= wrapper_get_block_class();
343 if (!ptr_block_class
) {
347 ptr_disk_type
= wrapper_get_disk_type();
348 if (!ptr_disk_type
) {
352 class_dev_iter_init(&iter
, ptr_block_class
, NULL
, ptr_disk_type
);
353 while ((dev
= class_dev_iter_next(&iter
))) {
354 struct gendisk
*disk
= dev_to_disk(dev
);
357 * Don't show empty devices or things that have been
360 if (get_capacity(disk
) == 0 ||
361 (disk
->flags
& LTTNG_GENHD_FL_HIDDEN
))
364 ret
= lttng_statedump_each_block_device(session
, disk
);
366 class_dev_iter_exit(&iter
);
374 void lttng_enumerate_device(struct lttng_kernel_session
*session
,
375 struct net_device
*dev
)
377 struct in_device
*in_dev
;
378 struct in_ifaddr
*ifa
;
380 if (dev
->flags
& IFF_UP
) {
381 in_dev
= in_dev_get(dev
);
383 for (ifa
= in_dev
->ifa_list
; ifa
!= NULL
;
384 ifa
= ifa
->ifa_next
) {
385 trace_lttng_statedump_network_interface(
391 trace_lttng_statedump_network_interface(
396 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0))
398 int lttng_enumerate_network_ip_interface(struct lttng_kernel_session
*session
)
400 struct net_device
*dev
;
403 for_each_netdev(&init_net
, dev
)
404 lttng_enumerate_device(session
, dev
);
411 int lttng_enumerate_network_ip_interface(struct lttng_kernel_session
*session
)
413 struct net_device
*dev
;
415 read_lock(&dev_base_lock
);
416 for_each_netdev(&init_net
, dev
)
417 lttng_enumerate_device(session
, dev
);
418 read_unlock(&dev_base_lock
);
422 #endif /* (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0)) */
423 #else /* CONFIG_INET */
425 int lttng_enumerate_network_ip_interface(struct lttng_kernel_session
*session
)
429 #endif /* CONFIG_INET */
432 int lttng_dump_one_fd(const void *p
, struct file
*file
, unsigned int fd
)
434 const struct lttng_fd_ctx
*ctx
= p
;
435 const char *s
= d_path(&file
->f_path
, ctx
->page
, PAGE_SIZE
);
436 unsigned int flags
= file
->f_flags
;
440 * We don't expose kernel internal flags, only userspace-visible
443 flags
&= ~FMODE_NONOTIFY
;
444 fdt
= files_fdtable(ctx
->files
);
447 * The fdt should only grow and iterate_fd() holds file_lock, which
448 * should ensure the fdt does not change while the lock is taken but be
449 * cautious and check anyway.
451 if (WARN_ON_ONCE(fd
>= fdt
->max_fds
))
454 if (lttng_close_on_exec(fd
, ctx
->files
))
458 * If d_path() failed to get a full path for the file, use the dentry
459 * name instead to at least get a filename.
462 struct dentry
*dentry
= file
->f_path
.dentry
;
464 /* Make sure we give at least some info */
465 spin_lock(&dentry
->d_lock
);
466 trace_lttng_statedump_file_descriptor(ctx
->session
,
467 ctx
->files
, fd
, dentry
->d_name
.name
, flags
,
469 spin_unlock(&dentry
->d_lock
);
472 trace_lttng_statedump_file_descriptor(ctx
->session
,
473 ctx
->files
, fd
, s
, flags
, file
->f_mode
);
478 /* Called with task lock held. */
480 void lttng_enumerate_files(struct lttng_kernel_session
*session
,
481 struct files_struct
*files
,
484 struct lttng_fd_ctx ctx
= { .page
= tmp
, .session
= session
, .files
= files
, };
486 lttng_iterate_fd(files
, 0, lttng_dump_one_fd
, &ctx
);
489 #ifdef LTTNG_HAVE_STATEDUMP_CPU_TOPOLOGY
491 int lttng_enumerate_cpu_topology(struct lttng_kernel_session
*session
)
494 const cpumask_t
*cpumask
= cpu_possible_mask
;
496 for (cpu
= cpumask_first(cpumask
); cpu
< nr_cpu_ids
;
497 cpu
= cpumask_next(cpu
, cpumask
)) {
498 trace_lttng_statedump_cpu_topology(session
, &cpu_data(cpu
));
505 int lttng_enumerate_cpu_topology(struct lttng_kernel_session
*session
)
513 * FIXME: we cannot take a mmap_sem while in a RCU read-side critical section
514 * (scheduling in atomic). Normally, the tasklist lock protects this kind of
515 * iteration, but it is not exported to modules.
518 void lttng_enumerate_task_vm_maps(struct lttng_kernel_session
*session
,
519 struct task_struct
*p
)
521 struct mm_struct
*mm
;
522 struct vm_area_struct
*map
;
525 /* get_task_mm does a task_lock... */
532 down_read(&mm
->mmap_sem
);
535 ino
= map
->vm_file
->lttng_f_dentry
->d_inode
->i_ino
;
538 trace_lttng_statedump_vm_map(session
, p
, map
, ino
);
541 up_read(&mm
->mmap_sem
);
547 int lttng_enumerate_vm_maps(struct lttng_kernel_session
*session
)
549 struct task_struct
*p
;
553 lttng_enumerate_task_vm_maps(session
, p
);
559 #ifdef CONFIG_LTTNG_HAS_LIST_IRQ
562 int lttng_list_interrupts(struct lttng_kernel_session
*session
)
565 unsigned long flags
= 0;
566 struct irq_desc
*desc
;
568 #define irq_to_desc wrapper_irq_to_desc
570 for_each_irq_desc(irq
, desc
) {
571 struct irqaction
*action
;
572 const char *irq_chip_name
=
573 irq_desc_get_chip(desc
)->name
? : "unnamed_irq_chip";
575 local_irq_save(flags
);
576 raw_spin_lock(&desc
->lock
);
577 for (action
= desc
->action
; action
; action
= action
->next
) {
578 trace_lttng_statedump_interrupt(session
,
579 irq
, irq_chip_name
, action
);
581 raw_spin_unlock(&desc
->lock
);
582 local_irq_restore(flags
);
589 int lttng_list_interrupts(struct lttng_kernel_session
*session
)
596 * Statedump the task's namespaces using the proc filesystem inode number as
597 * the unique identifier. The user and pid ns are nested and will be dumped
600 * Called with task lock held.
603 void lttng_statedump_process_ns(struct lttng_kernel_session
*session
,
604 struct task_struct
*p
,
605 enum lttng_thread_type type
,
606 enum lttng_execution_mode mode
,
607 enum lttng_execution_submode submode
,
608 enum lttng_process_status status
)
610 struct nsproxy
*proxy
;
611 struct pid_namespace
*pid_ns
;
612 struct user_namespace
*user_ns
;
615 * The pid and user namespaces are special, they are nested and
616 * accessed with specific functions instead of the nsproxy struct
617 * like the other namespaces.
619 pid_ns
= task_active_pid_ns(p
);
621 trace_lttng_statedump_process_pid_ns(session
, p
, pid_ns
);
622 pid_ns
= pid_ns
? pid_ns
->parent
: NULL
;
626 user_ns
= task_cred_xxx(p
, user_ns
);
628 trace_lttng_statedump_process_user_ns(session
, p
, user_ns
);
630 * trace_lttng_statedump_process_user_ns() internally
631 * checks whether user_ns is NULL. While this does not
632 * appear to be a possible return value for
633 * task_cred_xxx(), err on the safe side and check
634 * for NULL here as well to be consistent with the
635 * paranoid behavior of
636 * trace_lttng_statedump_process_user_ns().
638 user_ns
= user_ns
? user_ns
->lttng_user_ns_parent
: NULL
;
642 * Back and forth on locking strategy within Linux upstream for nsproxy.
643 * See Linux upstream commit 728dba3a39c66b3d8ac889ddbe38b5b1c264aec3
644 * "namespaces: Use task_lock and not rcu to protect nsproxy"
647 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,17,0) || \
648 LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,36, 3,14,0,0) || \
649 LTTNG_UBUNTU_KERNEL_RANGE(3,16,1,11, 3,17,0,0) || \
650 LTTNG_RHEL_KERNEL_RANGE(3,10,0,229,13,0, 3,11,0,0,0,0))
654 proxy
= task_nsproxy(p
);
657 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0))
658 trace_lttng_statedump_process_cgroup_ns(session
, p
, proxy
->cgroup_ns
);
660 trace_lttng_statedump_process_ipc_ns(session
, p
, proxy
->ipc_ns
);
661 #ifndef LTTNG_MNT_NS_MISSING_HEADER
662 trace_lttng_statedump_process_mnt_ns(session
, p
, proxy
->mnt_ns
);
664 trace_lttng_statedump_process_net_ns(session
, p
, proxy
->net_ns
);
665 trace_lttng_statedump_process_uts_ns(session
, p
, proxy
->uts_ns
);
666 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0) || \
667 LTTNG_RHEL_KERNEL_RANGE(4,18,0,305,0,0, 4,19,0,0,0,0))
668 trace_lttng_statedump_process_time_ns(session
, p
, proxy
->time_ns
);
671 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,17,0) || \
672 LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,36, 3,14,0,0) || \
673 LTTNG_UBUNTU_KERNEL_RANGE(3,16,1,11, 3,17,0,0) || \
674 LTTNG_RHEL_KERNEL_RANGE(3,10,0,229,13,0, 3,11,0,0,0,0))
682 int lttng_enumerate_process_states(struct lttng_kernel_session
*session
)
684 struct task_struct
*g
, *p
;
687 tmp
= (char *) __get_free_page(GFP_KERNEL
);
692 for_each_process(g
) {
693 struct files_struct
*prev_files
= NULL
;
697 enum lttng_execution_mode mode
=
699 enum lttng_execution_submode submode
=
701 enum lttng_process_status status
;
702 enum lttng_thread_type type
;
703 struct files_struct
*files
;
706 if (p
->exit_state
== EXIT_ZOMBIE
)
707 status
= LTTNG_ZOMBIE
;
708 else if (p
->exit_state
== EXIT_DEAD
)
710 else if (lttng_task_is_running(p
)) {
711 /* Is this a forked child that has not run yet? */
712 if (list_empty(&p
->rt
.run_list
))
713 status
= LTTNG_WAIT_FORK
;
716 * All tasks are considered as wait_cpu;
717 * the viewer will sort out if the task
718 * was really running at this time.
720 status
= LTTNG_WAIT_CPU
;
721 } else if (lttng_get_task_state(p
) &
722 (TASK_INTERRUPTIBLE
| TASK_UNINTERRUPTIBLE
)) {
723 /* Task is waiting for something to complete */
726 status
= LTTNG_UNNAMED
;
727 submode
= LTTNG_NONE
;
730 * Verification of t->mm is to filter out kernel
731 * threads; Viewer will further filter out if a
732 * user-space thread was in syscall mode or not.
735 type
= LTTNG_USER_THREAD
;
737 type
= LTTNG_KERNEL_THREAD
;
740 trace_lttng_statedump_process_state(session
,
741 p
, type
, mode
, submode
, status
, files
);
742 lttng_statedump_process_ns(session
,
743 p
, type
, mode
, submode
, status
);
745 * As an optimisation for the common case, do not
746 * repeat information for the same files_struct in
747 * two consecutive threads. This is the common case
748 * for threads sharing the same fd table. RCU guarantees
749 * that the same files_struct pointer is not re-used
750 * throughout processes/threads iteration.
752 if (files
&& files
!= prev_files
) {
753 lttng_enumerate_files(session
, files
, tmp
);
757 } while_each_thread(g
, p
);
761 free_page((unsigned long) tmp
);
767 void lttng_statedump_work_func(struct work_struct
*work
)
769 if (atomic_dec_and_test(&kernel_threads_to_run
))
770 /* If we are the last thread, wake up do_lttng_statedump */
771 wake_up(&statedump_wq
);
775 int do_lttng_statedump(struct lttng_kernel_session
*session
)
779 trace_lttng_statedump_start(session
);
780 ret
= lttng_enumerate_process_states(session
);
785 * ret = lttng_enumerate_vm_maps(session);
789 ret
= lttng_list_interrupts(session
);
792 ret
= lttng_enumerate_network_ip_interface(session
);
795 ret
= lttng_enumerate_block_devices(session
);
800 printk(KERN_WARNING
"LTTng: block device enumeration is not supported by kernel\n");
805 ret
= lttng_enumerate_cpu_topology(session
);
809 /* TODO lttng_dump_idt_table(session); */
810 /* TODO lttng_dump_softirq_vec(session); */
811 /* TODO lttng_list_modules(session); */
812 /* TODO lttng_dump_swap_files(session); */
815 * Fire off a work queue on each CPU. Their sole purpose in life
816 * is to guarantee that each CPU has been in a state where is was in
817 * syscall mode (i.e. not in a trap, an IRQ or a soft IRQ).
819 lttng_cpus_read_lock();
820 atomic_set(&kernel_threads_to_run
, num_online_cpus());
821 for_each_online_cpu(cpu
) {
822 INIT_DELAYED_WORK(&cpu_work
[cpu
], lttng_statedump_work_func
);
823 schedule_delayed_work_on(cpu
, &cpu_work
[cpu
], 0);
825 /* Wait for all threads to run */
826 __wait_event(statedump_wq
, (atomic_read(&kernel_threads_to_run
) == 0));
827 lttng_cpus_read_unlock();
828 /* Our work is done */
829 trace_lttng_statedump_end(session
);
834 * Called with session mutex held.
836 int lttng_statedump_start(struct lttng_kernel_session
*session
)
838 return do_lttng_statedump(session
);
840 EXPORT_SYMBOL_GPL(lttng_statedump_start
);
843 int __init
lttng_statedump_init(void)
846 * Allow module to load even if the fixup cannot be done. This
847 * will allow seemless transition when the underlying issue fix
848 * is merged into the Linux kernel, and when tracepoint.c
849 * "tracepoint_module_notify" is turned into a static function.
851 (void) wrapper_lttng_fixup_sig(THIS_MODULE
);
855 module_init(lttng_statedump_init
);
858 void __exit
lttng_statedump_exit(void)
862 module_exit(lttng_statedump_exit
);
864 MODULE_LICENSE("GPL and additional rights");
865 MODULE_AUTHOR("Jean-Hugues Deschenes");
866 MODULE_DESCRIPTION("LTTng statedump provider");
867 MODULE_VERSION(__stringify(LTTNG_MODULES_MAJOR_VERSION
) "."
868 __stringify(LTTNG_MODULES_MINOR_VERSION
) "."
869 __stringify(LTTNG_MODULES_PATCHLEVEL_VERSION
)
870 LTTNG_MODULES_EXTRAVERSION
);