-
Notifications
You must be signed in to change notification settings - Fork 18
RDKEMW-10467: Fix Invalid time values caused by drift #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| /* | ||||||
| * If not stated otherwise in this file or this component's LICENSE file the | ||||||
| * following copyright and licenses apply: | ||||||
|
Check failure on line 3 in source/bulkdata/profile.c
|
||||||
| * | ||||||
| * Copyright 2019 RDK Management | ||||||
| * | ||||||
|
|
@@ -349,8 +349,7 @@ | |||||
| struct timespec endTime; | ||||||
| struct timespec elapsedTime; | ||||||
| char* customLogPath = NULL; | ||||||
|
|
||||||
|
|
||||||
| int clockReturn = 0; | ||||||
|
|
||||||
| T2ERROR ret = T2ERROR_FAILURE; | ||||||
| if( profile->name == NULL || profile->encodingType == NULL || profile->protocol == NULL ) | ||||||
|
|
@@ -374,7 +373,7 @@ | |||||
| T2Info("%s ++in profileName : %s\n", __FUNCTION__, profile->name); | ||||||
|
|
||||||
|
|
||||||
| clock_gettime(CLOCK_REALTIME, &startTime); | ||||||
| clockReturn = clock_gettime(CLOCK_MONOTONIC, &startTime); | ||||||
| if( !strcmp(profile->encodingType, "JSON") || !strcmp(profile->encodingType, "MessagePack")) | ||||||
| { | ||||||
| JSONEncoding *jsonEncoding = profile->jsonEncoding; | ||||||
|
|
@@ -749,9 +748,16 @@ | |||||
| { | ||||||
| T2Error("Unsupported encoding format : %s\n", profile->encodingType); | ||||||
| } | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coverity issue no longer present as of: undefined Show issueCoverity Issue - Unchecked return valueCalling "clock_gettime" without checking return value (as is done elsewhere 1 out of 1 times). Medium Impact, CWE-252
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coverity issue no longer present as of: undefined Show issueCoverity Issue - Unchecked return valueCalling "clock_gettime" without checking return value (as is done elsewhere 1 out of 1 times). Medium Impact, CWE-252 |
||||||
| clock_gettime(CLOCK_REALTIME, &endTime); | ||||||
| getLapsedTime(&elapsedTime, &endTime, &startTime); | ||||||
| T2Info("Elapsed Time for : %s = %lu.%lu (Sec.NanoSec)\n", profile->name, (unsigned long )elapsedTime.tv_sec, elapsedTime.tv_nsec); | ||||||
| clockReturn |= clock_gettime(CLOCK_MONOTONIC, &endTime); | ||||||
| if(clockReturn) | ||||||
| { | ||||||
| T2Warning("Error in Fetching the time Elapsed"); | ||||||
|
||||||
| T2Warning("Error in Fetching the time Elapsed"); | |
| T2Warning("Failed to get time from clock_gettime()"); |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| /* | ||||||
| * If not stated otherwise in this file or this component's LICENSE file the | ||||||
| * following copyright and licenses apply: | ||||||
|
Check failure on line 3 in source/bulkdata/profilexconf.c
|
||||||
| * | ||||||
| * Copyright 2019 RDK Management | ||||||
| * | ||||||
|
|
@@ -247,8 +247,8 @@ | |||||
| T2Info("%s ++in profileName : %s\n", __FUNCTION__, profile->name); | ||||||
| } | ||||||
|
|
||||||
|
|
||||||
| clock_gettime(CLOCK_REALTIME, &startTime); | ||||||
| int clockReturn = 0; | ||||||
| clockReturn = clock_gettime(CLOCK_MONOTONIC, &startTime); | ||||||
shibu-kv marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+250
to
+251
|
||||||
| if(profile->encodingType != NULL && !strcmp(profile->encodingType, "JSON")) | ||||||
| { | ||||||
| if(T2ERROR_SUCCESS != initJSONReportXconf(&profile->jsonReportObj, &valArray)) | ||||||
|
|
@@ -304,13 +304,21 @@ | |||||
| encodeEventMarkersInJSON(valArray, profile->eMarkerList); | ||||||
| } | ||||||
| profile->grepSeekProfile->execCounter += 1; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coverity issue no longer present as of: undefined Show issueCoverity Issue - Unchecked return valueCalling "clock_gettime" without checking return value (as is done elsewhere 1 out of 1 times). Medium Impact, CWE-252 |
||||||
| T2Info("Execution Count = %d\n", profile->grepSeekProfile->execCounter); | ||||||
| T2Info("Xconf Profile Execution Count = %d\n", profile->grepSeekProfile->execCounter); | ||||||
|
|
||||||
| ret = prepareJSONReport(profile->jsonReportObj, &jsonReport); | ||||||
| destroyJSONReport(profile->jsonReportObj); | ||||||
| profile->jsonReportObj = NULL; | ||||||
| clock_gettime(CLOCK_REALTIME, &endTime); | ||||||
| T2Info("Processing time for profile %s is %ld seconds\n", profile->name, (long)(endTime.tv_sec - startTime.tv_sec)); | ||||||
| clockReturn |= clock_gettime(CLOCK_MONOTONIC, &endTime); | ||||||
| if(clockReturn) | ||||||
| { | ||||||
| T2Warning("Error in Fetching the time Elapsed"); | ||||||
|
||||||
| T2Warning("Error in Fetching the time Elapsed"); | |
| T2Warning("Failed to get time from clock_gettime()"); |
shibu-kv marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverity issue no longer present as of: undefined
Show issue
Coverity Issue - Unchecked return value
Calling "clock_gettime" without checking return value (as is done elsewhere 1 out of 1 times).
Medium Impact, CWE-252
CHECKED_RETURN
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message "Error in Fetching the time Elapsed" is grammatically incorrect and unclear. Consider revising to "Error fetching elapsed time" or "Failed to get time from clock_gettime()" to be more concise and accurate.
| T2Warning("Error in Fetching the time Elapsed"); | |
| T2Warning("Failed to get time from clock_gettime()"); |
Uh oh!
There was an error while loading. Please reload this page.