I have a sample application which uses a dynamically linked library library.so
. I was measuring CPU usage of the sample application with the top command. But it shows CPU usage of both sample app and library.so
per second. But I want to see the CPU usage of only the library.so
. Is there anyway to do this? I heard its achievable with htop but could not find out how. I used the tree view but it shows several processes as the sample app process. I could not understand which one is library.so
. I am using centos 5.11. Kernel version 3.2.63-1.el5.elrepo.
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
- What is the correct way to declare and use a FILE
Given the library is considered part of your program, one way would be to implement the measurement within your code. The following minimal example is implemented on C++11 running only one function from a hypothetical library:
You will need to extend this to all of the functions that your program invokes from your library.