Skip to content

时间记录bug #25

@iWindUpBird

Description

@iWindUpBird
static inline uint64_t getVirtualCallTime()
{
    struct timeval now;
    gettimeofday(&now, NULL);
    uint64_t time = (now.tv_sec % 1000) * 1000000 + now.tv_usec;
    return time;
}

这里的时间记录(now.tv_sec % 1000)有问题,如果999s增加到了1000s,则会出现由999s变为0s的情况。

戴铭的代码中后续对这里可能出现的情况做了处理(SMCallTraceCore.c 308行):

if (time < pRecord->time) {
     time += 100 * 1000000;
}

但你的代码遗漏了这里。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions