message: add -pid option to pcm-tsx
diff: @@ -278,6 +278,7 @@ int main(int argc, char * argv[])
  cerr << "\n";
  double delay = -1.0;
  + int pid{ -1 };
  char * sysCmd = NULL;
  char ** sysArgv = NULL;
  int cur_event;
  @@ -286,6 +287,8 @@ int main(int argc, char * argv[])
  MainLoop mainLoop;
  string program = string(argv[0]);
  + parsePID(argc, argv, pid);
  +
  PCM * m = PCM::getInstance();
  const size_t numCtrSupported = m->getMaxCustomCoreEvents();
  switch (m->getCPUModel())
  @@ -313,6 +316,12 @@ int main(int argc, char * argv[])
  print_usage(program);
  exit(EXIT_FAILURE);
  }
  + else if (isPIDOption(argv))
  + {
  + argv++;
  + argc--;
  + continue;
  + }
  else if (strncmp(*argv, "-csv", 4) == 0 ||
  strncmp(*argv, "/csv", 4) == 0)
  {
  @@ -442,7 +451,9 @@ int main(int argc, char * argv[])
  cerr << "No RTM support detected, but -F found as argument, running anyway.\n";
  }
  - PCM::ErrorCode status = m->program(PCM::EXT_CUSTOM_CORE_EVENTS, &conf);
  + print_pid_collection_message(pid);
  +
  + PCM::ErrorCode status = m->program(PCM::EXT_CUSTOM_CORE_EVENTS, &conf, false, pid);
  m->checkError(status);
  print_cpu_details();
  