Shared Object Viewer

How to build:

Make sure make, cmake, and git are installed.

git clone https://github.com/BBScholar/ECSE338_Final.git 
cd ECSE338_Final 
git submodule init
git pull --recurse-submodules

mkdir build && cd build 
cmake .. 
make 

Description:

This program can gather and display data pertaining to the shared objects being used by every process on the system. Data can be displayed in one of two ways:

  1. Processes will be displayed with a list of SO files currently being used by that process
  2. Shared objects will be displayed with a list of processes that are using that object

Data is displayed in a table, generated by the libfort library. libfort is a library that generates lightweight tables in C and C++.

PIDs and shared object names should be in increasing order and lexigraphical order respectively. This ordering is handled within the set and map classes provided by the c++ standard library. The unordered_set and unordered_map provide better performance (due to differing implementations from set and map), but do not order their keys nicely. It was determined that decrease in performance of the sets and maps is worth it in order to eliminate an additional sort later on.

Usage:

The binary is generated within the build directory and is named shared_info. It is convenient to pipe the output directly into less in order to be able to scroll the output with greater ease. This can also be piped to a file or other programs if need be.

To run with processes as section headers:

./shared_info -proc | less

Example output: Proc Flag Image

To run with shared objects as section headers:

./shared_info -obj | less

Example output: Obj Flag Image

Possible Issues:

If there is an SO or a process with a particularly long name, the format of the graph is ruined. This can be fixed by increasing the size of terminal or decrease the font size.

Text wrapping just doesn't look nice sometimes. Dynamically wrapping text is hard.

Possible Future Improvements:

  • Ability to print out 1 PID or 1 SO heading at a time.
  • Interactive mode (command line interface with commands specific to this application)