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
);
446 * We need to check here again whether fd is within the fdt
447 * max_fds range, because we might be seeing a different
448 * files_fdtable() than iterate_fd(), assuming only RCU is
449 * protecting the read. In reality, iterate_fd() holds
450 * file_lock, which should ensure the fdt does not change while
451 * the lock is taken, but we are not aware whether this is
452 * guaranteed or not, so play safe.
454 if (fd
< fdt
->max_fds
&& lttng_close_on_exec(fd
, fdt
))
457 struct dentry
*dentry
= file
->f_path
.dentry
;
459 /* Make sure we give at least some info */
460 spin_lock(&dentry
->d_lock
);
461 trace_lttng_statedump_file_descriptor(ctx
->session
,
462 ctx
->files
, fd
, dentry
->d_name
.name
, flags
,
464 spin_unlock(&dentry
->d_lock
);
467 trace_lttng_statedump_file_descriptor(ctx
->session
,
468 ctx
->files
, fd
, s
, flags
, file
->f_mode
);
473 /* Called with task lock held. */
475 void lttng_enumerate_files(struct lttng_kernel_session
*session
,
476 struct files_struct
*files
,
479 struct lttng_fd_ctx ctx
= { .page
= tmp
, .session
= session
, .files
= files
, };
481 lttng_iterate_fd(files
, 0, lttng_dump_one_fd
, &ctx
);
484 #ifdef LTTNG_HAVE_STATEDUMP_CPU_TOPOLOGY
486 int lttng_enumerate_cpu_topology(struct lttng_kernel_session
*session
)
489 const cpumask_t
*cpumask
= cpu_possible_mask
;
491 for (cpu
= cpumask_first(cpumask
); cpu
< nr_cpu_ids
;
492 cpu
= cpumask_next(cpu
, cpumask
)) {
493 trace_lttng_statedump_cpu_topology(session
, &cpu_data(cpu
));
500 int lttng_enumerate_cpu_topology(struct lttng_kernel_session
*session
)
508 * FIXME: we cannot take a mmap_sem while in a RCU read-side critical section
509 * (scheduling in atomic). Normally, the tasklist lock protects this kind of
510 * iteration, but it is not exported to modules.
513 void lttng_enumerate_task_vm_maps(struct lttng_kernel_session
*session
,
514 struct task_struct
*p
)
516 struct mm_struct
*mm
;
517 struct vm_area_struct
*map
;
520 /* get_task_mm does a task_lock... */
527 down_read(&mm
->mmap_sem
);
530 ino
= map
->vm_file
->lttng_f_dentry
->d_inode
->i_ino
;
533 trace_lttng_statedump_vm_map(session
, p
, map
, ino
);
536 up_read(&mm
->mmap_sem
);
542 int lttng_enumerate_vm_maps(struct lttng_kernel_session
*session
)
544 struct task_struct
*p
;
548 lttng_enumerate_task_vm_maps(session
, p
);
554 #ifdef CONFIG_LTTNG_HAS_LIST_IRQ
557 int lttng_list_interrupts(struct lttng_kernel_session
*session
)
560 unsigned long flags
= 0;
561 struct irq_desc
*desc
;
563 #define irq_to_desc wrapper_irq_to_desc
565 for_each_irq_desc(irq
, desc
) {
566 struct irqaction
*action
;
567 const char *irq_chip_name
=
568 irq_desc_get_chip(desc
)->name
? : "unnamed_irq_chip";
570 local_irq_save(flags
);
571 raw_spin_lock(&desc
->lock
);
572 for (action
= desc
->action
; action
; action
= action
->next
) {
573 trace_lttng_statedump_interrupt(session
,
574 irq
, irq_chip_name
, action
);
576 raw_spin_unlock(&desc
->lock
);
577 local_irq_restore(flags
);
584 int lttng_list_interrupts(struct lttng_kernel_session
*session
)
591 * Statedump the task's namespaces using the proc filesystem inode number as
592 * the unique identifier. The user and pid ns are nested and will be dumped
595 * Called with task lock held.
598 void lttng_statedump_process_ns(struct lttng_kernel_session
*session
,
599 struct task_struct
*p
,
600 enum lttng_thread_type type
,
601 enum lttng_execution_mode mode
,
602 enum lttng_execution_submode submode
,
603 enum lttng_process_status status
)
605 struct nsproxy
*proxy
;
606 struct pid_namespace
*pid_ns
;
607 struct user_namespace
*user_ns
;
610 * The pid and user namespaces are special, they are nested and
611 * accessed with specific functions instead of the nsproxy struct
612 * like the other namespaces.
614 pid_ns
= task_active_pid_ns(p
);
616 trace_lttng_statedump_process_pid_ns(session
, p
, pid_ns
);
617 pid_ns
= pid_ns
? pid_ns
->parent
: NULL
;
621 user_ns
= task_cred_xxx(p
, user_ns
);
623 trace_lttng_statedump_process_user_ns(session
, p
, user_ns
);
625 * trace_lttng_statedump_process_user_ns() internally
626 * checks whether user_ns is NULL. While this does not
627 * appear to be a possible return value for
628 * task_cred_xxx(), err on the safe side and check
629 * for NULL here as well to be consistent with the
630 * paranoid behavior of
631 * trace_lttng_statedump_process_user_ns().
633 user_ns
= user_ns
? user_ns
->lttng_user_ns_parent
: NULL
;
637 * Back and forth on locking strategy within Linux upstream for nsproxy.
638 * See Linux upstream commit 728dba3a39c66b3d8ac889ddbe38b5b1c264aec3
639 * "namespaces: Use task_lock and not rcu to protect nsproxy"
642 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,17,0) || \
643 LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,36, 3,14,0,0) || \
644 LTTNG_UBUNTU_KERNEL_RANGE(3,16,1,11, 3,17,0,0) || \
645 LTTNG_RHEL_KERNEL_RANGE(3,10,0,229,13,0, 3,11,0,0,0,0))
649 proxy
= task_nsproxy(p
);
652 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0))
653 trace_lttng_statedump_process_cgroup_ns(session
, p
, proxy
->cgroup_ns
);
655 trace_lttng_statedump_process_ipc_ns(session
, p
, proxy
->ipc_ns
);
656 #ifndef LTTNG_MNT_NS_MISSING_HEADER
657 trace_lttng_statedump_process_mnt_ns(session
, p
, proxy
->mnt_ns
);
659 trace_lttng_statedump_process_net_ns(session
, p
, proxy
->net_ns
);
660 trace_lttng_statedump_process_uts_ns(session
, p
, proxy
->uts_ns
);
661 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0) || \
662 LTTNG_RHEL_KERNEL_RANGE(4,18,0,305,0,0, 4,19,0,0,0,0))
663 trace_lttng_statedump_process_time_ns(session
, p
, proxy
->time_ns
);
666 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,17,0) || \
667 LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,36, 3,14,0,0) || \
668 LTTNG_UBUNTU_KERNEL_RANGE(3,16,1,11, 3,17,0,0) || \
669 LTTNG_RHEL_KERNEL_RANGE(3,10,0,229,13,0, 3,11,0,0,0,0))
677 int lttng_enumerate_process_states(struct lttng_kernel_session
*session
)
679 struct task_struct
*g
, *p
;
682 tmp
= (char *) __get_free_page(GFP_KERNEL
);
687 for_each_process(g
) {
688 struct files_struct
*prev_files
= NULL
;
692 enum lttng_execution_mode mode
=
694 enum lttng_execution_submode submode
=
696 enum lttng_process_status status
;
697 enum lttng_thread_type type
;
698 struct files_struct
*files
;
701 if (p
->exit_state
== EXIT_ZOMBIE
)
702 status
= LTTNG_ZOMBIE
;
703 else if (p
->exit_state
== EXIT_DEAD
)
705 else if (lttng_task_is_running(p
)) {
706 /* Is this a forked child that has not run yet? */
707 if (list_empty(&p
->rt
.run_list
))
708 status
= LTTNG_WAIT_FORK
;
711 * All tasks are considered as wait_cpu;
712 * the viewer will sort out if the task
713 * was really running at this time.
715 status
= LTTNG_WAIT_CPU
;
716 } else if (lttng_get_task_state(p
) &
717 (TASK_INTERRUPTIBLE
| TASK_UNINTERRUPTIBLE
)) {
718 /* Task is waiting for something to complete */
721 status
= LTTNG_UNNAMED
;
722 submode
= LTTNG_NONE
;
725 * Verification of t->mm is to filter out kernel
726 * threads; Viewer will further filter out if a
727 * user-space thread was in syscall mode or not.
730 type
= LTTNG_USER_THREAD
;
732 type
= LTTNG_KERNEL_THREAD
;
735 trace_lttng_statedump_process_state(session
,
736 p
, type
, mode
, submode
, status
, files
);
737 lttng_statedump_process_ns(session
,
738 p
, type
, mode
, submode
, status
);
740 * As an optimisation for the common case, do not
741 * repeat information for the same files_struct in
742 * two consecutive threads. This is the common case
743 * for threads sharing the same fd table. RCU guarantees
744 * that the same files_struct pointer is not re-used
745 * throughout processes/threads iteration.
747 if (files
&& files
!= prev_files
) {
748 lttng_enumerate_files(session
, files
, tmp
);
752 } while_each_thread(g
, p
);
756 free_page((unsigned long) tmp
);
762 void lttng_statedump_work_func(struct work_struct
*work
)
764 if (atomic_dec_and_test(&kernel_threads_to_run
))
765 /* If we are the last thread, wake up do_lttng_statedump */
766 wake_up(&statedump_wq
);
770 int do_lttng_statedump(struct lttng_kernel_session
*session
)
774 trace_lttng_statedump_start(session
);
775 ret
= lttng_enumerate_process_states(session
);
780 * ret = lttng_enumerate_vm_maps(session);
784 ret
= lttng_list_interrupts(session
);
787 ret
= lttng_enumerate_network_ip_interface(session
);
790 ret
= lttng_enumerate_block_devices(session
);
795 printk(KERN_WARNING
"LTTng: block device enumeration is not supported by kernel\n");
800 ret
= lttng_enumerate_cpu_topology(session
);
804 /* TODO lttng_dump_idt_table(session); */
805 /* TODO lttng_dump_softirq_vec(session); */
806 /* TODO lttng_list_modules(session); */
807 /* TODO lttng_dump_swap_files(session); */
810 * Fire off a work queue on each CPU. Their sole purpose in life
811 * is to guarantee that each CPU has been in a state where is was in
812 * syscall mode (i.e. not in a trap, an IRQ or a soft IRQ).
814 lttng_cpus_read_lock();
815 atomic_set(&kernel_threads_to_run
, num_online_cpus());
816 for_each_online_cpu(cpu
) {
817 INIT_DELAYED_WORK(&cpu_work
[cpu
], lttng_statedump_work_func
);
818 schedule_delayed_work_on(cpu
, &cpu_work
[cpu
], 0);
820 /* Wait for all threads to run */
821 __wait_event(statedump_wq
, (atomic_read(&kernel_threads_to_run
) == 0));
822 lttng_cpus_read_unlock();
823 /* Our work is done */
824 trace_lttng_statedump_end(session
);
829 * Called with session mutex held.
831 int lttng_statedump_start(struct lttng_kernel_session
*session
)
833 return do_lttng_statedump(session
);
835 EXPORT_SYMBOL_GPL(lttng_statedump_start
);
838 int __init
lttng_statedump_init(void)
841 * Allow module to load even if the fixup cannot be done. This
842 * will allow seemless transition when the underlying issue fix
843 * is merged into the Linux kernel, and when tracepoint.c
844 * "tracepoint_module_notify" is turned into a static function.
846 (void) wrapper_lttng_fixup_sig(THIS_MODULE
);
850 module_init(lttng_statedump_init
);
853 void __exit
lttng_statedump_exit(void)
857 module_exit(lttng_statedump_exit
);
859 MODULE_LICENSE("GPL and additional rights");
860 MODULE_AUTHOR("Jean-Hugues Deschenes");
861 MODULE_DESCRIPTION("LTTng statedump provider");
862 MODULE_VERSION(__stringify(LTTNG_MODULES_MAJOR_VERSION
) "."
863 __stringify(LTTNG_MODULES_MINOR_VERSION
) "."
864 __stringify(LTTNG_MODULES_PATCHLEVEL_VERSION
)
865 LTTNG_MODULES_EXTRAVERSION
);