From: John L. <mov...@us...> - 2003-01-10 22:22:45
|
Update of /cvsroot/oprofile/oprofile/daemon In directory sc8-pr-cvs1:/tmp/cvs-serv27086/daemon Modified Files: opd_image.c oprofiled.c Log Message: move complete_dump Index: opd_image.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_image.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- opd_image.c 10 Jan 2003 22:15:49 -0000 1.22 +++ opd_image.c 10 Jan 2003 22:22:39 -0000 1.23 @@ -381,21 +381,6 @@ } -static void complete_dump() -{ - FILE *status_file; - - /* Done writing out the samples, indicate with complete_dump file */ - status_file = fopen(OP_DUMP_STATUS, "w"); - if (!status_file) { - fprintf(stderr, "Couldn't set %s !\n", OP_DUMP_STATUS); - exit(EXIT_FAILURE); - } - fprintf(status_file, "1\n"); - fclose(status_file); -} - - // FIXME: pid/pgrp filter ? void opd_process_samples(char const * buffer, size_t count) { @@ -449,7 +434,4 @@ break; } } - - // FIXME: this should be done by the caller I think - complete_dump(); } Index: oprofiled.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/oprofiled.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- oprofiled.c 10 Jan 2003 22:15:49 -0000 1.20 +++ oprofiled.c 10 Jan 2003 22:22:40 -0000 1.21 @@ -437,6 +437,22 @@ mypid = getpid(); } + +/** Done writing out the samples, indicate with complete_dump file */ +static void complete_dump() +{ + FILE * status_file = fopen(OP_DUMP_STATUS, "w"); + + if (!status_file) { + fprintf(stderr, "Couldn't set %s !\n", OP_DUMP_STATUS); + exit(EXIT_FAILURE); + } + + fprintf(status_file, "1\n"); + fclose(status_file); +} + + /** * opd_do_samples - process a sample buffer * @param opd_buf buffer to process @@ -460,6 +476,8 @@ verbprintf("Read buffer of %d entries.\n", (unsigned int) num); opd_process_samples(opd_buf, num); + + complete_dump(); sigprocmask(SIG_UNBLOCK, &maskset, NULL); } |