tpm2-software / tpm2-tools

The source repository for the Trusted Platform Module (TPM2.0) tools
https://tpm2-software.github.io
720 stars 379 forks source link

Enable debug not working #2887

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hello,

I would like to enable debug in order to display this log trace: https://github.com/tpm2-software/tpm2-tss/blob/master/src/tss2-esys/api/Esys_StartAuthSession.c#L190

I already had tpm2-tools installed, so I recompiled the library and the tools:

tpm2-tss:

make clean
./bootstrap
./configure --with-maxloglevel=trace --enable-debug=yes
make -j5
sudo make install

tpm2-tools:

make clean
./bootstrap
./configure --enable-debug=yes
make -j5
sudo make install

After that, I ran this tpm2-tools command:

$ tpm2_startauthsession -S session.ctx -V
** Some not important INFO log **
$ tpm2_getrandom 5 -v
tool="tpm2_getrandom" version="5.2-54-ge4f5e2fc" tctis="libtss2-tctildr" tcti-default=tcti-device

But it's not working, I got no TRACE log, how can I solve this ?

Greetings.

idesai commented 2 years ago

export TSS2_LOG=all+trace

ghost commented 2 years ago

Thank you @idesai, do you know if this is documented somewhere ? Aswell as all other environnement variable like TPM2TOOLS_TCTI for example.

idesai commented 2 years ago

They are in the man pages. You can also see them here and here.

qizhangz commented 2 years ago

Hi,

With "export TSS2_LOG=all+trace", I still can't see the strace of tpm2-tss.

Is there any additional set up?

williamcroberts commented 2 years ago

Hi,

With "export TSS2_LOG=all+trace", I still can't see the strace of tpm2-tss.

this will only output a bunch of logs for the tpm2-tss project libraries (like tss2-esys). It will not cause additional output from the tools code itself. You won't get an strace, you'll get the function traces from explicit logging code in the libraries.

Is there any additional set up?

Their shouldn't be assuming that the env variable was set in the environment you're running in and was set prior to execution of a tpm2-tool.