Tango kernel profiling

Hello

for a while I've been trying to profile PyTango with Python specific profilers. However, since it uses C++ kernel, they fail to get the job done (hence, I post here, not in Python subgroup). I'd like to know how professional Tango developers get to know:
- objects memory, addresses and relations
- threads creation and synchronisation
- polling threads
- events (how do you filter them)

Regards

BTW: why there are 2 ZMQ threads on server side?
Hi, I'm not 100% sure to understand what you really want. Sorry in advance for that.

To profile a C++ device server and the Tango C++ library, we recently used Callgrind/KCacheGrind (https://kcachegrind.github.io/html/Home.html) to understand the following issue for instance: https://github.com/tango-controls/cppTango/issues/424
This method gives a lot of details on the time spent in each method.

I am not sure about what you mean with: how Tango developers get to know:
- objects memory, addresses and relations

A debugger (gdb) can provide this information. I am not sure to understand what you mean with relations here.

About thread creation, gdb can help here since it notifies you when a new thread is created. It provides as well ways to navigate through different threads.
About the synchronization, I am not sure to understand what you would like to know. Could you give us more details?

The polling threads are threads like other threads. What would you like to know? How is configured the device server? With how many polling threads? You can get this info from the Polling threads manager (right click on device server instance name in jive and click on "Polling threads manager" or on Astor, right-click on a device server and select "Pool Threads Manager").

How do we filter events?
Again, I am not sure to understand what you would like to achieve.
If we need to debug something related to events, we are using some dedicated Tango clients which will subscribe to the events we are interested in. You can for instance use the event manager (which is using JTango) which is available in astor (View -> Event Manager, then select the attributes you are interested in, right-click and choose what kind of event you would like to subscribe to). You can also write a simple C++ generic client subscribing to the events you are interested in and displaying the contents of the events received on the client side. Here is a link to the source code of a simple one: https://github.com/tango-controls/cppTango/files/1514610/event.zip
You can also use the TANGO logs and the LogViewer to apply some filters on the logs displayed.
You can also use tcpdump/wireshark to debug events related issues to see whether a server is really sending an event on the network and if it is received by a given client.

About the question why there are 2 ZMQ implementation threads on the server side, I guess it is because the Device Server is using 2 different ZMQ sockets, which are listening on 2 different ports, one dedicated to the heartbeat system and one dedicated to the Tango events publication. So my guess is that ZMQ is using a dedicated thread for each ZMQ socket port made available.
For information, you can actually know what are the ports used by your device server for the heartbeat and for event publication simply by sending the ZmqEventSubscriptionChange command to your admin device with "info" as parameter.

I hope this helps a bit.
Kind regards,
Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
 
Register or login to create to post a reply.