-
Notifications
You must be signed in to change notification settings - Fork 21
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
Changes from all commits
1883418
ec64c37
d048d01
7d5d223
e5b5017
f2507df
9f37ece
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/profilexconf.c
|
||
| * | ||
| * Copyright 2019 RDK Management | ||
| * | ||
|
|
@@ -246,8 +246,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
shibu-kv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if(profile->encodingType != NULL && !strcmp(profile->encodingType, "JSON")) | ||
| { | ||
| if(T2ERROR_SUCCESS != initJSONReportXconf(&profile->jsonReportObj, &valArray)) | ||
|
|
@@ -303,13 +303,21 @@ | |
| encodeEventMarkersInJSON(valArray, profile->eMarkerList); | ||
| } | ||
| profile->grepSeekProfile->execCounter += 1; | ||
shibu-kv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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) | ||
shibu-kv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| T2Warning("Failed to get time from clock_gettime()"); | ||
| } | ||
| else | ||
| { | ||
| T2Info("%s Xconf Profile Processing Time in seconds : %ld\n", profile->name, (long)(endTime.tv_sec - startTime.tv_sec)); | ||
shibu-kv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| if(ret != T2ERROR_SUCCESS) | ||
| { | ||
| T2Error("Unable to generate report for : %s\n", profile->name); | ||
|
|
@@ -449,9 +457,17 @@ | |
| T2Warning("Failed to save grep config to file for profile: %s\n", profile->name); | ||
| } | ||
|
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 |
||
| #endif | ||
| 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("Failed to get time from clock_gettime()"); | ||
shibu-kv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| else | ||
| { | ||
| getLapsedTime(&elapsedTime, &endTime, &startTime); | ||
| T2Info("Elapsed Time for : %s = %lu.%lu (Sec.NanoSec)\n", profile->name, (unsigned long)elapsedTime.tv_sec, elapsedTime.tv_nsec); | ||
| } | ||
|
|
||
| if(jsonReport) | ||
| { | ||
| free(jsonReport); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.