- /* to handle the scheduling events */
- bt_ctf_iter_add_callback(iter,
- g_quark_from_static_string("sched_switch"),
- NULL, 0, handle_sched_switch, NULL, NULL, NULL);
- /* to clean up the process table */
- bt_ctf_iter_add_callback(iter,
- g_quark_from_static_string("sched_process_free"),
- NULL, 0, handle_sched_process_free, NULL, NULL, NULL);
-
- /* for IO top */
- bt_ctf_iter_add_callback(iter,
- g_quark_from_static_string("exit_syscall"),
- NULL, 0, handle_exit_syscall, NULL, NULL, NULL);
- bt_ctf_iter_add_callback(iter,
- g_quark_from_static_string("sys_write"),
- NULL, 0, handle_sys_write, NULL, NULL, NULL);
- bt_ctf_iter_add_callback(iter,
- g_quark_from_static_string("sys_read"),
- NULL, 0, handle_sys_read, NULL, NULL, NULL);
- bt_ctf_iter_add_callback(iter,
- g_quark_from_static_string("sys_open"),
- NULL, 0, handle_sys_open, NULL, NULL, NULL);
-
- bt_ctf_iter_add_callback(iter,
- g_quark_from_static_string("sys_close"),
- NULL, 0, handle_sys_close, NULL, NULL, NULL);
+ if (opt_textdump) {
+ bt_ctf_iter_add_callback(iter, 0, NULL, 0,
+ print_timestamp,
+ NULL, NULL, NULL);
+ } else {
+ /* at each event check if we need to refresh */
+ bt_ctf_iter_add_callback(iter, 0, NULL, 0,
+ check_timestamp,
+ NULL, NULL, NULL);
+ /* to handle the scheduling events */
+ bt_ctf_iter_add_callback(iter,
+ g_quark_from_static_string("sched_switch"),
+ NULL, 0, handle_sched_switch, NULL, NULL, NULL);
+ /* to clean up the process table */
+ bt_ctf_iter_add_callback(iter,
+ g_quark_from_static_string("sched_process_free"),
+ NULL, 0, handle_sched_process_free, NULL, NULL, NULL);
+ /* to get all the process from the statedumps */
+ bt_ctf_iter_add_callback(iter,
+ g_quark_from_static_string(
+ "lttng_statedump_process_state"),
+ NULL, 0, handle_statedump_process_state,
+ NULL, NULL, NULL);
+
+ /* for IO top */
+ bt_ctf_iter_add_callback(iter,
+ g_quark_from_static_string("exit_syscall"),
+ NULL, 0, handle_exit_syscall, NULL, NULL, NULL);
+ bt_ctf_iter_add_callback(iter,
+ g_quark_from_static_string("sys_write"),
+ NULL, 0, handle_sys_write, NULL, NULL, NULL);
+ bt_ctf_iter_add_callback(iter,
+ g_quark_from_static_string("sys_read"),
+ NULL, 0, handle_sys_read, NULL, NULL, NULL);
+ bt_ctf_iter_add_callback(iter,
+ g_quark_from_static_string("sys_open"),
+ NULL, 0, handle_sys_open, NULL, NULL, NULL);
+ bt_ctf_iter_add_callback(iter,
+ g_quark_from_static_string("sys_close"),
+ NULL, 0, handle_sys_close, NULL, NULL, NULL);
+ bt_ctf_iter_add_callback(iter,
+ g_quark_from_static_string(
+ "lttng_statedump_file_descriptor"),
+ NULL, 0, handle_statedump_file_descriptor,
+ NULL, NULL, NULL);
+
+ /* for kprobes */
+ if (lttngtop.kprobes_table) {
+ for (i = 0; i < lttngtop.kprobes_table->len; i++) {
+ kprobe = g_ptr_array_index(lttngtop.kprobes_table, i);
+ bt_ctf_iter_add_callback(iter,
+ g_quark_from_static_string(
+ kprobe->probe_name),
+ NULL, 0, handle_kprobes,
+ NULL, NULL, NULL);
+ }
+ }
+ }
+