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 stats don't track calls to produce() #7213

Open
Notou opened this issue Mar 25, 2024 · 0 comments
Open

Perf Counter stats don't track calls to produce() #7213

Notou opened this issue Mar 25, 2024 · 0 comments

Comments

@Notou
Copy link
Contributor

Notou commented Mar 25, 2024

What happened?

The Performance Counter variables tracking the number of produced items (nproduced, avg_nproduced, and var_nproduced)
only account for the return value of the block's work function.

It doesn't account for situations where produce(port, num) is called inside of that work function.
This means that, in this case, the reported nproduced stat is incorrect.

In the most extreme case, where a block only advertises its produced items through calls to produce(), the perf counter stats stay at 0.

d = nproduced - d_avg_nproduced;
d_ins_nproduced = nproduced;
d_avg_nproduced = d_avg_nproduced + d / d_pc_counter;
d_var_nproduced = d_var_nproduced + d * d;

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

The issue can be seen from even a simple embedded python block.

Just replace the return value in the default work function by consume and produce calls:

def work(self, input_items, output_items):
    """example: multiply with constant"""
    output_items[0][:] = input_items[0] * self.example_param
    self.consume(0, len(output_items[0]))
    self.produce(0, len(output_items[0]))
    return 0

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

Relevant log output

No response

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