+ g_quark_from_static_string("syscall_entry_close"),
+ NULL, 0, handle_sys_close, NULL, NULL, NULL);
+
+ 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("syscall_exit_open"),
+ NULL, 0, handle_exit_syscall, NULL, NULL, NULL);
+ bt_ctf_iter_add_callback(iter,
+ g_quark_from_static_string("syscall_exit_socket"),
+ NULL, 0, handle_exit_syscall, NULL, NULL, NULL);
+ bt_ctf_iter_add_callback(iter,
+ g_quark_from_static_string("syscall_exit_close"),
+ NULL, 0, handle_exit_syscall, NULL, NULL, NULL);
+ if (opt_textdump) {
+ bt_ctf_iter_add_callback(iter, 0, NULL, 0,
+ textdump,
+ 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);
+ /* for IO top */
+ 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("syscall_entry_write"),
+ NULL, 0, handle_sys_write, NULL, NULL, NULL);
+ bt_ctf_iter_add_callback(iter,
+ g_quark_from_static_string("syscall_exit_write"),
+ NULL, 0, handle_exit_syscall, 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("syscall_entry_read"),
+ NULL, 0, handle_sys_read, NULL, NULL, NULL);
+ bt_ctf_iter_add_callback(iter,
+ g_quark_from_static_string("syscall_exit_read"),
+ NULL, 0, handle_exit_syscall, 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);
+ }
+ }
+ }
+
+ if (opt_exec_name) {
+ pid_t pid;
+
+ pid = fork();
+ if (pid == 0) {
+ execvpe(opt_exec_name, opt_exec_argv, opt_exec_env);
+ exit(EXIT_SUCCESS);
+ } else if (pid > 0) {
+ opt_exec_pid = pid;
+ g_hash_table_insert(tid_filter_list,
+ (gpointer) &pid,
+ &pid);
+ } else {
+ perror("fork");
+ exit(EXIT_FAILURE);
+ }
+ }