pcm icon indicating copy to clipboard operation
pcm copied to clipboard

pcm* commands should show version information using '-v, --version'

Open sscargal opened this issue 2 years ago • 4 comments

Currently, none of the pcm* commands list the version. It would be helpful to implement a -v, --version subcommand to list the version of the binaries and exit back to the prompt.

sscargal avatar Mar 19 '22 19:03 sscargal

I think a version number, or a date string is good enough, perhaps we can create some cmake magic to extract the release tag and use that during build as a string constant for the version?

ogbrugge avatar Mar 19 '22 20:03 ogbrugge

we have already PCM_VERSION macro that contains the date string and also the git hash id. It is auto-generated by git export when one downloads pcm zip/tgz from github. PCM_VERSION can be output in --version subcommand.

$ git grep PCM_VERSION
src/pcm-iio.cpp:    std::cout << "\n Processor Counter Monitor " << PCM_VERSION << "\n";
src/pcm-latency.cpp:    std::cout << "\n Processor Counter Monitor " << PCM_VERSION << "\n";
src/pcm-memory.cpp:    cerr << " Processor Counter Monitor: Memory Bandwidth Monitoring Utility " << PCM_VERSION << "\n";
src/pcm-mmio.cpp:    std::cout << "\n Processor Counter Monitor " << PCM_VERSION << "\n";
src/pcm-msr.cpp:    std::cout << "\n Processor Counter Monitor " << PCM_VERSION << "\n";
src/pcm-pcicfg.cpp:    std::cout << "\n Processor Counter Monitor " << PCM_VERSION << "\n";
src/pcm-power.cpp:    cerr << "\n Processor Counter Monitor " << PCM_VERSION << "\n";
src/pcm-sensor.cpp:    cout << "CPU counter sensor " << PCM_VERSION << "\n";
src/pcm.cpp:    cerr << " Processor Counter Monitor " << PCM_VERSION << "\n";
src/version.h:#define PCM_VERSION " ($Format:%ci ID=%h$)"

opcm avatar Mar 21 '22 07:03 opcm

Every time I build and then run pcm tools I see "Processor Counter Monitor ($Format:%ci ID=%h$)", this string is not properly replaced. What do I need to do or is this string expansion buggy?

./pcm-iio

Processor Counter Monitor ($Format:%ci ID=%h$)

This utility measures Skylake-SP IIO information

ogbrugge avatar Mar 21 '22 09:03 ogbrugge

the IDs are replaced by "git archive"

opcm avatar Mar 21 '22 09:03 opcm

the version option has been implemented:

src/pcm-iio.cpp:    cout << "  --version                          => print application version\n";
src/pcm-latency.cpp:    cout << " --version                 => print application version\n";
src/pcm-memory.cpp:    cout << "  --version                          => print application version\n";
src/pcm-mmio.cpp:    std::cout << "   --version   : print application version\n";
src/pcm-msr.cpp:    std::cout << "   --version   : print application version\n";
src/pcm-numa.cpp:    cout << "  --version                          => print application version\n";
src/pcm-pcicfg.cpp:    std::cout << "   --version   : print application version\n";
src/pcm-pcie.cpp:    cout << "  --version                          => print application version\n";
src/pcm-power.cpp:    cout << "  --version                          => print application version\n";
src/pcm-raw.cpp:    cout << "  --version                              => print application version\n";
src/pcm-sensor-server.cpp:    std::cout << "    --version            : Print application version\n";
src/pcm-tpmi.cpp:    std::cout << "   --version   : print application version\n";
src/pcm-tsx.cpp:    cout << "  --version                          => print application version\n";
src/pcm.cpp:    cout << "  --version                          => print application version\n";
src/utils.cpp:        if (check_argument_equals(*argv, {"--version"}))

rdementi avatar Nov 20 '23 20:11 rdementi