X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lttng-statedump-impl.c;h=1c09e51a8ce6a454b4bb8c86b3e079789cc9cfcd;hb=e0407e483deb67b6f8617d7100278c97313a9914;hp=dad51ddaa25013f1bd5453aca4352854bd1ec6eb;hpb=d561ecfbc9a17ca47721cd6d7742d2b1835f8ae3;p=lttng-modules.git diff --git a/lttng-statedump-impl.c b/lttng-statedump-impl.c index dad51dda..1c09e51a 100644 --- a/lttng-statedump-impl.c +++ b/lttng-statedump-impl.c @@ -47,15 +47,16 @@ #include #include -#include "lttng-events.h" -#include "lttng-tracer.h" -#include "wrapper/irqdesc.h" -#include "wrapper/spinlock.h" -#include "wrapper/fdtable.h" -#include "wrapper/nsproxy.h" -#include "wrapper/irq.h" -#include "wrapper/tracepoint.h" -#include "wrapper/genhd.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef CONFIG_LTTNG_HAS_LIST_IRQ #include @@ -63,9 +64,10 @@ /* Define the tracepoints, but do not build the probes */ #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH ../instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module #define TRACE_INCLUDE_FILE lttng-statedump -#include "instrumentation/events/lttng-module/lttng-statedump.h" +#define LTTNG_INSTRUMENTATION +#include DEFINE_TRACE(lttng_statedump_block_device); DEFINE_TRACE(lttng_statedump_end); @@ -236,7 +238,7 @@ int lttng_dump_one_fd(const void *p, struct file *file, unsigned int fd) * the lock is taken, but we are not aware whether this is * guaranteed or not, so play safe. */ - if (fd < fdt->max_fds && test_bit(fd, fdt->close_on_exec)) + if (fd < fdt->max_fds && lttng_close_on_exec(fd, fdt)) flags |= O_CLOEXEC; if (IS_ERR(s)) { struct dentry *dentry = file->f_path.dentry; @@ -314,7 +316,7 @@ void lttng_enumerate_task_vm_maps(struct lttng_session *session, down_read(&mm->mmap_sem); while (map) { if (map->vm_file) - ino = map->vm_file->f_dentry->d_inode->i_ino; + ino = map->vm_file->lttng_f_dentry->d_inode->i_ino; else ino = 0; trace_lttng_statedump_vm_map(session, p, map, ino); @@ -378,6 +380,9 @@ int lttng_list_interrupts(struct lttng_session *session) } #endif +/* + * Called with task lock held. + */ static void lttng_statedump_process_ns(struct lttng_session *session, struct task_struct *p, @@ -386,23 +391,14 @@ void lttng_statedump_process_ns(struct lttng_session *session, enum lttng_execution_submode submode, enum lttng_process_status status) { - struct nsproxy *proxy; struct pid_namespace *pid_ns; - rcu_read_lock(); - proxy = task_nsproxy(p); - if (proxy) { - pid_ns = lttng_get_proxy_pid_ns(proxy); - do { - trace_lttng_statedump_process_state(session, - p, type, mode, submode, status, pid_ns); - pid_ns = pid_ns->parent; - } while (pid_ns); - } else { + pid_ns = task_active_pid_ns(p); + do { trace_lttng_statedump_process_state(session, - p, type, mode, submode, status, NULL); - } - rcu_read_unlock(); + p, type, mode, submode, status, pid_ns); + pid_ns = pid_ns->parent; + } while (pid_ns); } static @@ -498,6 +494,8 @@ int do_lttng_statedump(struct lttng_session *session) return ret; ret = lttng_enumerate_block_devices(session); switch (ret) { + case 0: + break; case -ENOSYS: printk(KERN_WARNING "LTTng: block device enumeration is not supported by kernel\n"); break;