Debugging code for seeing what threads are created

Hi,
my name is Alexandru Buda, and I’m doing a project in college based on
GNU Radio.

I’m using the environment variable GR_SCHEDULER to enable/disable
multi-threading
for benchmarking purposes and also the linux command “ps” to see the
threads created.
This unfortunately only gives me the number of threads and no more
detail as to what
each one is doing.

A few years ago my supervisor did some work with GNU Radio (3.1.2 and
3.1.3) and used the variable
GR_TOP_BLOCK_IMPL_DEBUG from
gnuradio-core/src/lib/runtime/gr_top_block_impl.cc
to see what threads are created but it seems that the code using
GR_TOP_BLOCK_IMPL_DEBUG
has been removed.

Is there any debugging variables that I can enable or how do I see
extra information available about my running
waveform?
Or is there a linux/python tool that will give me more information
about the threads?

Not sure if this is relevant but I’m using GNU Radio 3.2.2 built from
source on Ubuntu 10.04 32bit

Any information would be greatly appreciated

Thank you

Alex

On Mon, Jul 19, 2010 at 06:46:05PM +0100, Alex wrote:

each one is doing.
Please read the ps man page and pick options that will show you detail
information on all the threads.

Or is there a linux/python tool that will give me more information
about the threads?

Not exactly sure what you’re looking for, but when using the
thread-per-block scheduler, there will be one thread created per
block.

Not sure if this is relevant but I’m using GNU Radio 3.2.2 built from
source on Ubuntu 10.04 32bit

Any information would be greatly appreciated

Thank you
Alex

Eric

Please read the ps man page and pick options that will show you detail
information on all the threads.

Reread the man page but from what i gather ps isn’t capable of
displaying
what I’m looking for, which is a name for the thread, or something to
tell
me which block it belongs to.

Not exactly sure what you’re looking for, but when using the
thread-per-block scheduler, there will be one thread created per
block.

I am aware of that and I’m looking for some sort of output to tell me
something along the lines of when a block starts, what it’s doing and
when it stops.

Also when I run in single-thread scheduler I have a waveform that runs
with 3 threads and one with 2 threads and I would like to know what they
are

Thank you

Alex

On Tue, Jul 20, 2010 at 11:04:25AM +0100, Alex wrote:

Please read the ps man page and pick options that will show you detail
information on all the threads.

Reread the man page but from what i gather ps isn’t capable of displaying
what I’m looking for, which is a name for the thread, or something to tell
me which block it belongs to.

Right. They don’t have names.

You might want to try oprofile. It’ll give you an idea which routines
are burning up the most time, but it won’t tie it back to which thread.

You might be able to get something useful by using getrusage(2),
specifying RUSAGE_THREAD. Off the top of my head, for the
thread-per-block scheduler, I suggest putting the call into
gr_block_executor::~gr_block_executor, as the last thing.
It’ll get called just before the thread is deleted.

In the destructor, the name of block is available as
d_block->name(). You can also use std::cout << d_block

with 3 threads and one with 2 threads and I would like to know what they
are

When using the single-threaded-scheduler, if the flow graph consists
of more than 1 distinct subgraph, each subgraph will get its own
thread. (Most often you’ll see this with a transceiver, where the Tx
and Rx are implemented by separate hier blocks that are contained by
the single top_block, but aren’t otherwise connected to each other.)

Thank you

You’re welcome!

Eric

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs