Skip to content
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

Perf Counter track WORK_CALLED_PRODUCE (and WORK_DONE) as negative produced items #7214

Open
Notou opened this issue Mar 25, 2024 · 1 comment

Comments

@Notou
Copy link
Contributor

Notou commented Mar 25, 2024

What happened?

As mentioned in #7213, the perf counter stat for produced items only uses the work function return value.
And it uses it directly, as an int:

int n =
m->general_work(noutput_items, d_ninput_items, d_input_items, d_output_items);
#ifdef GR_PERFORMANCE_COUNTERS
if (d_use_pc)
d->stop_perf_counters(noutput_items, n);

So, in cases where the work function uses either WORK_CALLED_PRODUCE, or WORK_DONE, the perf counter counts that as -2 (resp -1) produced items.

System Information

OS: Linux Mint 21.3
GR Installation Method: Conda

GNU Radio Version

3.10 (maint-3.10)

Specific Version

3.10.9.2

Steps to Reproduce the Problem

Make any c++ block, (sync, or not) (It seems gr.WORK_CALLED_PRODUCE is not accepted as return value in Python...)
And have the return value to WORK_CALLED_PRODUCE, setting explicitly produce() and consume() with the right values.

And insert it in whatever flowgraph.
Running gr-ctrlport-monitor, you can see nproduced, avg_nproduced, and var_nproduced at -2 for that block.
CtrlPort Monitor capture

Relevant log output

No response

@Notou
Copy link
Contributor Author

Notou commented Mar 25, 2024

And more than WORK_CALLED_PRODUCE or WORK_DONE, any negative return value will be taken as face value by the perf counter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants