Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions source/bulkdata/profile.c
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

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'source/bulkdata/profile.c' (Match: rdk/components/generic/telemetry/rdk/components/generic/telemetry/1, 1548 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/telemetry/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz, file: source/bulkdata/profile.c)

Check failure on line 3 in source/bulkdata/profile.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'source/bulkdata/profile.c' (Match: rdk/components/generic/telemetry/rdk/components/generic/telemetry/2102, 1548 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/telemetry/+archive/rdk-dev-2102.tar.gz, file: source/bulkdata/profile.c)

Check failure on line 3 in source/bulkdata/profile.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'source/bulkdata/profile.c' (Match: rdk/components/generic/telemetry/rdk/components/generic/telemetry/1, 1548 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/telemetry/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz, file: source/bulkdata/profile.c)

Check failure on line 3 in source/bulkdata/profile.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'source/bulkdata/profile.c' (Match: rdk/components/generic/telemetry/rdk/components/generic/telemetry/2102, 1548 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/telemetry/+archive/rdk-dev-2102.tar.gz, file: source/bulkdata/profile.c)
*
* Copyright 2019 RDK Management
*
Expand Down Expand Up @@ -354,8 +354,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 )
Expand All @@ -379,7 +378,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;
Expand Down Expand Up @@ -754,9 +753,16 @@
{
T2Error("Unsupported encoding format : %s\n", profile->encodingType);
}
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()");
}
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(ret == T2ERROR_SUCCESS && jsonReport)
{
free(jsonReport);
Expand Down
32 changes: 24 additions & 8 deletions source/bulkdata/profilexconf.c
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

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'source/bulkdata/profilexconf.c' (Match: rdk/components/generic/telemetry/rdk/components/generic/telemetry/1, 1000 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/telemetry/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz, file: source/bulkdata/profilexconf.c)

Check failure on line 3 in source/bulkdata/profilexconf.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'source/bulkdata/profilexconf.c' (Match: rdk/components/generic/telemetry/rdk/components/generic/telemetry/1, 1000 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/telemetry/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz, file: source/bulkdata/profilexconf.c)
*
* Copyright 2019 RDK Management
*
Expand Down Expand Up @@ -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);
if(profile->encodingType != NULL && !strcmp(profile->encodingType, "JSON"))
{
if(T2ERROR_SUCCESS != initJSONReportXconf(&profile->jsonReportObj, &valArray))
Expand Down Expand Up @@ -303,13 +303,21 @@
encodeEventMarkersInJSON(valArray, profile->eMarkerList);
}
profile->grepSeekProfile->execCounter += 1;
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("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));
}

if(ret != T2ERROR_SUCCESS)
{
T2Error("Unable to generate report for : %s\n", profile->name);
Expand Down Expand Up @@ -449,9 +457,17 @@
T2Warning("Failed to save grep config to file for profile: %s\n", profile->name);
}
Copy link
Contributor

@rdkcmf-jenkins rdkcmf-jenkins Nov 19, 2025

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

#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()");
}
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);
Expand Down
Loading