Skip to content

Commit 183a767

Browse files
committed
print trace file name with offset
1 parent 5fa50c2 commit 183a767

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/gufi_trace2index.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ struct OutputBuffers debug_output_buffers;
8787

8888
struct ScoutArgs {
8989
struct input *in; /* reference to PoolArgs */
90+
char *tracename;
9091
int trace; /* file descriptor */
9192

9293
/* everything below is locked with print_mutex from debug.h */
@@ -561,7 +562,8 @@ static int scout_function(QPTPool_t *ctx, const size_t id, void *data, void *arg
561562
line = NULL;
562563
size = 0;
563564
len = 0;
564-
fprintf(stderr, "Scout encountered bad line ending at offset %jd\n", (intmax_t) offset);
565+
fprintf(stderr, "Scout encountered bad line ending at %s offset %jd\n",
566+
sa->tracename, (intmax_t) offset);
565567
return 1;
566568
}
567569

@@ -747,6 +749,7 @@ int main(int argc, char *argv[]) {
747749
/* freed by scout_function */
748750
struct ScoutArgs *sa = malloc(sizeof(struct ScoutArgs));
749751
sa->in = &pa.in;
752+
sa->tracename = argv[idx + i];
750753
sa->trace = traces[i];
751754
sa->remaining = &remaining;
752755
sa->time = &scout_time;

test/regression/gufi_trace2index.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Total Files: 0
118118

119119
# file delimiter not found
120120
$ gufi_trace2index -d "|" -n "2" "badtrace" "prefix"
121-
Scout encountered bad line ending at offset 24
121+
Scout encountered bad line ending at badtrace offset 24
122122
Creating GUFI Index prefix with 2 threads
123123
Total Dirs: 0
124124
Total Files: 0

0 commit comments

Comments
 (0)