X-Git-Url: https://git.lttng.org/?p=lttngtop.git;a=blobdiff_plain;f=src%2Fiostreamtop.c;fp=src%2Fiostreamtop.c;h=35a58a414f8e6274ac7898e9e18d099bb75bb390;hp=71843cb900137a2adb706a5124800c221724f391;hb=e05a35a69ff03f10bba459a07dc26684049f1bc9;hpb=e7be7d41e3d858361b656b5664b581d224949ae6 diff --git a/src/iostreamtop.c b/src/iostreamtop.c index 71843cb..35a58a4 100644 --- a/src/iostreamtop.c +++ b/src/iostreamtop.c @@ -55,6 +55,8 @@ void add_file(struct processtop *proc, struct files *file, int fd) } file->fd = fd; file->flag = __NR_open; + lttngtop.nbfiles++; + lttngtop.nbnewfiles++; } /* TODO */ @@ -85,7 +87,6 @@ void insert_file(struct processtop *proc, int fd) tmp->fd = fd; add_file(proc, tmp, fd); } else { - tmp = g_ptr_array_index(proc->process_files_table, fd); if (tmp == NULL) { tmp = g_new0(struct files, 1); @@ -102,10 +103,12 @@ void close_file(struct processtop *proc, int fd) { struct files *file; - file = get_file(proc, fd); - if (file != NULL) + if (file != NULL) { file->flag = __NR_close; + lttngtop.nbfiles--; + } + lttngtop.nbclosedfiles++; } struct files *get_file(struct processtop *proc, int fd)