Home
Support

Knowledge Base

BSPs and drivers
Community resources
Product documentation
Questions?
Contact us

How to have the correct thread ID in slog2info -t output
 
________________________________________________________________________

Applicable Environment
________________________________________________________________________
  • Topic: slog2info -t option
  • SDP: 7.0.0, 7.1.0
  • Target: AArch64, x86_64
________________________________________________________________________

Issue
________________________________________________________________________
    When using slogf() in code, slog2info -t option does not Display the thread ID.


    ________________________________________________________________________

    Solution
    ________________________________________________________________________
      slog2info -t argument adds a column in the slog2info output and prints the id of the calling thread.

      If this number is 0 for any thread (even for threads with id different to 0) then your are probably using the legacy slog APIs, i.e. [v]slogf, slogi, slogb do not pass the thread-id as part of the log message.

      A solution is to use libslog2shim, for example:

      LD_PRELOAD=<path_to_lib>/libslog2shim.so.1 <process_name> ...

      Or using the slog2 API. Only the slog2 logging APIs directly append the thread-id as part of the log: [v]slog2f[a], slog2c.


      ________________________________________________________________________
      NOTE: This entry has been validated against the SDP version listed above. Use caution when considering this advice for any other SDP version. For supported releases, please reach out to QNX Technical Support if you have any questions/concerns.
      ________________________________________________________________________


      Related Attachments
       None Found





      Please contact us with your questions or concerns.