timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
tim::config Namespace Reference

Functions

template<typename Func >
void read_command_line (Func &&_func)
 this only works on Linux where there is a /proc/<PID>/cmdline file More...
 

Function Documentation

◆ read_command_line()

template<typename Func >
void tim::config::read_command_line ( Func &&  _func)

this only works on Linux where there is a /proc/<PID>/cmdline file

Definition at line 65 of file config.hpp.

66{
67#if defined(TIMEMORY_LINUX)
68 auto _cmdline = tim::read_command_line(tim::process::get_target_id());
70 {
71 for(auto& itr : _cmdline)
72 std::cout << itr << " ";
73 std::cout << std::endl;
74 }
75
76 int _argc = _cmdline.size();
77 char** _argv = new char*[_argc];
78 for(int i = 0; i < _argc; ++i)
79 _argv[i] = (char*) _cmdline.at(i).c_str();
80 _func(_argc, _argv);
81 delete[] _argv;
82#else
83 consume_parameters(_func);
84#endif
85}
std::vector< std::string > read_command_line(pid_t _pid)
Definition: utility.cpp:114
void consume_parameters(ArgsT &&...)
Definition: types.hpp:285

References tim::consume_parameters(), tim::debug, tim::read_command_line(), and tim::verbose.

Referenced by timemory_trace_init().