X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Fcortex_m.c;h=79af632ac7faca703292f02055072b1fb033738a;hb=f444c57bf2d692171b7b50a6ce477265f951f77e;hp=24063a7e6af06dc49bbf083cb0c72a6f05226dcc;hpb=4e0371bf718c9eb3a862e3c9b113c95cd4c3a479;p=openocd.git diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 24063a7e6a..79af632ac7 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -1787,8 +1787,7 @@ int cortex_m_profiling(struct target *target, uint32_t *samples, gettimeofday(&now, NULL); - if (sample_count >= max_num_samples || - (now.tv_sec >= timeout.tv_sec && now.tv_usec >= timeout.tv_usec)) { + if (sample_count >= max_num_samples || timeval_compare(&now, &timeout) > 0) { LOG_INFO("Profiling completed. %" PRIu32 " samples.", sample_count); break; }