return -1;
}
+void update_kprobes_display()
+{
+ int i, column;
+
+ set_window_title(center, "Kprobes Top");
+ /*
+ wattron(center, A_BOLD);
+ column = 1;
+ for (i = 0; i < 6; i++) {
+ if (toggle_virt < 0 && (i == 3 || i == 4)) {
+ continue;
+ }
+ if (cputopview[i].sort) {
+ wattron(center, A_UNDERLINE);
+ pref_current_sort = i;
+ }
+ mvwprintw(center, 1, column, cputopview[i].title);
+ wattroff(center, A_UNDERLINE);
+ column += 10;
+ }
+ wattroff(center, A_BOLD);
+ */
+}
+
void update_cputop_display()
{
int i;
case tree:
update_cputop_display();
break;
+ case kprobes:
+ update_kprobes_display();
+ break;
default:
break;
}
selected_line = 0;
update_current_view();
break;
+ case KEY_F(5):
+ if (pref_panel_visible)
+ toggle_pref_panel();
+ current_view = kprobes;
+ selected_line = 0;
+ update_current_view();
+ break;
case KEY_F(10):
case 'q':
reset_ncurses();
printf("%s", bt_ctf_get_string(list[i]));
} else if (type == CTF_TYPE_ARRAY) {
str = bt_ctf_get_char_array(list[i]);
- if (str)
+ if (!bt_ctf_field_get_error() && str)
printf("%s", str);
}
}
cpu_id = get_cpu_id(call_data);
procname = get_context_comm(call_data);
- if (strcmp(bt_ctf_event_name(call_data), "exit_syscall") == 0) {
+ if ((strcmp(bt_ctf_event_name(call_data), "exit_syscall") == 0) && !last_textdump_print_newline) {
scope = bt_ctf_get_top_level_scope(call_data,
BT_EVENT_FIELDS);
syscall_ret = bt_ctf_get_int64(bt_ctf_get_field(call_data,
bt_ctf_event_name(call_data));
print_fields(call_data);
printf(") ");
- /*
- if (strncmp(bt_ctf_event_name(call_data), "sys_", 4) == 0) {
- } else {
+ if (strncmp(bt_ctf_event_name(call_data), "sys_", 4) != 0) {
printf("\n");
+ last_textdump_print_newline = 1;
+ } else {
+ last_textdump_print_newline = 0;
}
- */
- last_textdump_print_newline = 0;
}
end:
NULL, NULL, NULL);
}
- while ((event = bt_ctf_iter_read_event(iter, NULL)) != NULL) {
+ while ((event = bt_ctf_iter_read_event(iter)) != NULL) {
if (quit || reload_trace)
goto end_iter;
ret = bt_iter_next(bt_ctf_get_iter(iter));
goto error_session;
}
+ memset(&ev, '\0', sizeof(struct lttng_event));
ev.type = LTTNG_EVENT_SYSCALL;
if ((ret = lttng_enable_event(handle, &ev, channel_name)) < 0) {
fprintf(stderr,"error enabling syscalls : %s\n",
goto error_session;
}
+ /*
+ memset(&ev, '\0', sizeof(struct lttng_event));
+ ev.type = LTTNG_EVENT_PROBE;
+ sprintf(ev.attr.probe.symbol_name, "sys_open");
+ sprintf(ev.name, "probe_sys_open");
+ ev.attr.probe.addr = 0;
+ ev.attr.probe.offset = 0;
+ if ((ret = lttng_enable_event(handle, &ev, channel_name)) < 0) {
+ fprintf(stderr,"error enabling kprobes : %s\n",
+ helper_lttcomm_get_readable_code(ret));
+ goto error_session;
+ }
+ */
+
kctxpid.ctx = LTTNG_EVENT_CONTEXT_PID;
lttng_add_context(handle, &kctxpid, NULL, NULL);
kctxtid.ctx = LTTNG_EVENT_CONTEXT_TID;