make profiling script find all coolwsds

there might be coolwsds launched from another service which doesn't
match -u coolwsd, so use -t coolwsd instead to capture all of them

then their output might be interleaved, so switch to another log
format that retains the name[pid] and stable sort on that column
so we have all the matching lines for a name[pid] contiguous but
ordered within that by time. After the sort, cut to drop the
columns that are additional over the 'cat' format.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Id1d1c37001249ff348d6c09c005fb0836133258c
pull/8597/head
Caolán McNamara 2024-03-21 13:15:29 +00:00 committed by Miklos Vajna
parent f29a7c63df
commit 339e724ae6
1 changed files with 7 additions and 1 deletions

View File

@ -31,7 +31,13 @@ pkill -SIGUSR1 kitbroker
echo Waiting 1 second for results
sleep 1
echo ---systemd journal---
journalctl --since @$date -u coolwsd --output=cat | grep -P "\Wpid:|\WjailedUrl:|\WviewId:.*userExtraInfo:"
# We might have multiple coolwsds and we want the output from all of them.
# But we want lines from each pid to be grouped together, and each group
# of lines to be in chronological order.
# So use short-unix to retain the name[pid], stable sort on that key
# then use cut to remove the columns we only included to get the desired
# order
journalctl --since @$date -t "coolwsd" -o short-unix | sort -s -k3,3 | cut -d " " -f 4- | grep -P "\Wpid:|\WjailedUrl:|\WviewId:.*userExtraInfo:"
if [ -e /tmp/coolwsd.log ]; then
echo ---local dev log---
tail -c +$locallogsize /tmp/coolwsd.log | grep -P "\Wpid:|\WjailedUrl:|\WviewId:.*userExtraInfo:"