Skip to content

Commit f0b2f95

Browse files
committed
Preserve the type of the trace time in Task::trace_time()
FrameTime is a long (int64 in the trace) while trace_time() casts it to a u32. Preserve the original type by making the function return type FrameTime.
1 parent 126ceea commit f0b2f95

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/StdioMonitor.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace rr {
1313
Switchable StdioMonitor::will_write(Task* t) {
1414
if (t->session().mark_stdio()) {
1515
char buf[256];
16-
snprintf(buf, sizeof(buf) - 1, "[rr %d %d]", t->tgid(), t->trace_time());
16+
snprintf(buf, sizeof(buf) - 1, "[rr %d %ld]", t->tgid(), t->trace_time());
1717
ssize_t len = strlen(buf);
1818
if (write(original_fd, buf, len) != len) {
1919
ASSERT(t, false) << "Couldn't write to " << original_fd;

src/Task.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,7 @@ const string& Task::trace_dir() const {
19741974
return trace->dir();
19751975
}
19761976

1977-
uint32_t Task::trace_time() const {
1977+
FrameTime Task::trace_time() const {
19781978
const TraceStream* trace = trace_stream();
19791979
return trace ? trace->time() : 0;
19801980
}

src/Task.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ class Task {
704704
* events. |task_time()| returns that "time" wrt this task
705705
* only.
706706
*/
707-
uint32_t trace_time() const;
707+
FrameTime trace_time() const;
708708

709709
/**
710710
* Call this to reset syscallbuf_hdr->num_rec_bytes and zero out the data

0 commit comments

Comments
 (0)