log_wrapper.sh to convert trace to text (#3271)

This commit is contained in:
Daiki AMINAKA 2022-12-07 15:05:45 -08:00 коммит произвёл GitHub
Родитель 2d76cf2633
Коммит bef15dddbb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 17 добавлений и 9 удалений

Просмотреть файл

@ -130,17 +130,21 @@ As already indicated, there are lots of ways to collect ETW traces. Feel free to
## Linux
This script wraps steps bellows
### All in one command
This script wraps collecting trace then converting to text as well
**WARN**: This wrapper doesn't work with `./scripts/test.ps1` etc. as it is also creating lttng session internally.
```
./scripts/log_wrapper.sh ${Your binary}
```sh
cd ${MSQUIC_PATH}
./scripts/log_wrapper.sh ${YOUR_COMMAND}
# e.g.
./scripts/log_wrapper.sh ./artifacts/bin/linux/x64_Debug_openssl/msquictest --gtest_filter=Basic.*
ls msquic_lttng0
# data quic.babel.txt quic.log
```
### Step by step command
Instead, you can use the following commands:
To start collecting a trace, you can use the following commands:
```
```sh
mkdir msquic_lttng
lttng create msquic -o=./msquic_lttng
lttng enable-event --userspace "CLOG_*"

Просмотреть файл

@ -2,9 +2,10 @@
lttng destroy msquic 2> /dev/null
dirname="msquic_lttng"
num=`find ./* -maxdepth 0 -name "$dirname*" | wc -l`
mkdir $dirname$num && lttng create msquic -o=./$dirname$num && sessionCreated=$? && lttng enable-event --userspace "CLOG_*" && lttng add-context --userspace --type=vpid --type=vtid && lttng start
dirprefix="msquic_lttng"
num=`find ./* -maxdepth 0 -name "$dirprefix*" | wc -l`
dirname=$dirprefix$num
mkdir -p $dirname/data && lttng create msquic -o=./$dirname/data && sessionCreated=$? && lttng enable-event --userspace "CLOG_*" && lttng add-context --userspace --type=vpid --type=vtid && lttng start
if [ $? -eq 0 ]; then
$*
lttng stop
@ -12,4 +13,7 @@ fi
if [ $sessionCreated -eq 0 ]; then
lttng destroy msquic
babeltrace --names all $dirname/data > $dirname/quic.babel.txt
${HOME}/.dotnet/tools/clog2text_lttng -i $dirname/quic.babel.txt -s ./src/manifest/clog.sidecar -o $dirname/quic.log --showTimestamp --showCpuInfo
fi