Skip to content

RDKEMW-16851: Fix for skipfrequency issue in top markers#332

Open
yogeswaransky wants to merge 9 commits intosupport/1.8from
topic/RDKEMW-16851
Open

RDKEMW-16851: Fix for skipfrequency issue in top markers#332
yogeswaransky wants to merge 9 commits intosupport/1.8from
topic/RDKEMW-16851

Conversation

@yogeswaransky
Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
@yogeswaransky yogeswaransky requested a review from a team as a code owner April 15, 2026 11:58
Copilot AI review requested due to automatic review settings April 15, 2026 11:58
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes stale Top Marker values when skipFreq causes marker processing to be skipped, by relocating/resetting per-interval marker values in the Top Marker processing flow.

Changes:

  • Removed cpuValue/memValue cleanup from getProcUsage().
  • Added cleanup of cpuValue/memValue in processTopPattern() before the skip-frequency check.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
source/dcautil/dcaproc.c Removes per-call freeing of TopMarker CPU/memory strings from getProcUsage().
source/dcautil/dca.c Clears previous Top Marker CPU/memory values before applying skip-frequency logic.
Comments suppressed due to low confidence (1)

source/dcautil/dcaproc.c:235

  • getProcUsage() now overwrites marker->cpuValue/marker->memValue with strdup() results without freeing any existing values. This changes the function’s ownership/cleanup contract and will leak memory if the same TopMarker is passed repeatedly without the caller clearing these fields first. Consider restoring the defensive free/nulling inside getProcUsage() (it’s safe even if callers already cleared), or explicitly document/enforce the expectation that the caller must reset these fields before calling.
        if(0 != getProcInfo(&pInfo, filename))
        {
            T2Debug("Process info - CPU: %s, Memory: %s \n", pInfo.cpuUse, pInfo.memUse);
            marker->cpuValue = strdup(pInfo.cpuUse);
            marker->memValue = strdup(pInfo.memUse);

Comment thread source/dcautil/dca.c Outdated
Comment thread source/dcautil/dca.c
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Copilot AI review requested due to automatic review settings April 15, 2026 15:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes skip-frequency behavior for “top” markers (CPU/memory) in the DCA utility flow, and expands CI coverage to additional maintenance branches.

Changes:

  • Increase BUF_LEN used by procMemCpuInfo fields to avoid truncation.
  • Move/reset handling of TopMarker CPU/memory values and adjust top parsing PID fallback flow.
  • Trigger L1/L2 GitHub Actions workflows for PRs targeting support/1.8 in addition to develop.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
source/dcautil/dcautil.h Expands BUF_LEN constant used for process/CPU/mem string storage.
source/dcautil/dcaproc.c Removes per-call freeing of marker CPU/mem strings; tweaks PID fallback braces in getCPUInfo().
source/dcautil/dca.c Adds freeing/reset of TopMarker CPU/mem values before skip-frequency logic in the first pass.
.github/workflows/L2-tests.yml Runs L2 workflow for PRs into develop and support/1.8.
.github/workflows/L1-tests.yml Runs L1 workflow for PRs into develop and support/1.8.
Comments suppressed due to low confidence (1)

source/dcautil/dcaproc.c:236

  • getProcUsage() no longer frees existing marker->cpuValue / marker->memValue, but it still overwrites them with strdup(). Unless every caller guarantees these pointers are NULL before calling (which is not true for all markers in processTopPattern() due to the early break), this will leak memory each time the marker is processed. Either restore the free+NULL logic here before assignment, or switch to updating through a helper that replaces/free+sets the value safely.
        pInfo.total_instance = index;
        pInfo.pid = pid;
        if(0 != getProcInfo(&pInfo, filename))
        {
            T2Debug("Process info - CPU: %s, Memory: %s \n", pInfo.cpuUse, pInfo.memUse);
            marker->cpuValue = strdup(pInfo.cpuUse);
            marker->memValue = strdup(pInfo.memUse);

Comment thread source/dcautil/dca.c
Comment thread source/dcautil/dca.c
Comment thread source/dcautil/dcaproc.c
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
@AravindanNC AravindanNC deleted the topic/RDKEMW-16851 branch April 15, 2026 17:26
@AravindanNC AravindanNC restored the topic/RDKEMW-16851 branch April 15, 2026 17:26
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2026
@yogeswaransky yogeswaransky reopened this Apr 15, 2026
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Copilot AI review requested due to automatic review settings April 15, 2026 17:50
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
@yogeswaransky yogeswaransky self-assigned this Apr 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants