Giter VIP home page Giter VIP logo

etrace's Introduction

etrace

Actions Status Snap Status etrace Go Report Card

etrace is a utility like strace or ltrace which uses ptrace to follow programs executed by a main program for performance and debugging analysis. It also supports limited tracing of file accesses for analyzing what files a program accesses during it's execution.

Basics

Simple, quick (relatively speaking) and dirty way to get numbers on how fast/slow a graphical snap like gnome-calculator is:

Worst case performance (like when you first turn on and log into your machine):

$ etrace exec -t --silent --cold gnome-calculator
Total startup time: 4.169633359

Best case performance (after everything is cached and ready to go):

$ etrace exec -t --silent --hot gnome-calculator > /dev/null # to warm up all caches
$ etrace exec -t --silent --hot gnome-calculator # actual measurement
Total startup time: 1.054272336

Installation

The easiest way to get etrace is via a snap:

$ snap install etrace

It is currently under active development, and thus it is suggested to install from the candidate channel with the --candidate option.

Alternatively, this project uses go modules, so you can also git clone it and then go install it.

$ git clone https://github.com/anonymouse64/etrace 
$ cd etrace && go install ./...

Usage

etrace has three subcommands, exec, file, and analyze-snap.

exec subcommand

exec is used for tracing the programs that are executed with the execve family of syscalls. It can also have tracing turned off to just measure graphical timing information.

etrace exec usage:

Usage:
  etrace [OPTIONS] exec [exec-OPTIONS] Cmd...

Application Options:
  -e, --errors                    Show errors as they happen
  -w, --window-name=              Window name to wait for
  -p, --prepare-script=           Script to run to prepare a run
      --prepare-script-args=      Args to provide to the prepare script
  -r, --restore-script=           Script to run to restore after a run
      --restore-script-args=      Args to provide to the restore script
  -v, --keep-vm-caches            Don't free VM caches before executing
  -c, --class-name=               Window class to use with xdotool instead of the the first Command
      --window-class-name=        Window class name to use with xdotool
  -s, --use-snap-run              Run command through snap run
  -f, --use-flatpak-run           Run command through flatpak run
  -d, --discard-snap-ns           Discard the snap namespace before running the snap
      --cmd-stdout=               Log file for run command's stdout
      --silent                    Silence all program output
      --cmd-stderr=               Log file for run command's stderr
  -j, --json                      Output results in JSON
  -o, --output-file=              A file to output the results (empty string means stdout)
      --no-window-wait            Don't wait for the window to appear, just run until the program exits
      --window-timeout=           Global timeout for waiting for windows to appear. Set to empty string to use no timeout (default: 60s)

Help Options:
  -h, --help                      Show this help message

[exec command options]
      -t, --no-trace              Don't trace the process, just time the total execution
          --clean-snap-user-data  Delete snap user data before executing and restore after execution
          --reinstall-snap        Reinstall the snap before executing, restoring any existing interface connections for the snap
      -n, --repeat=               Number of times to repeat each task
          --cold                  Use set of options for worst case, cold cache, etc performance
          --hot                   Use set of options for best case, hot cache, etc performance

[exec command arguments]
  Cmd:                            Command to run

file subcommand

The file subcommand will track all syscalls that a program executes which access files. This is useful for measuring the total set of files that a program attempts to access during its execution.

etrace file usage:

Usage:
  etrace [OPTIONS] file [file-OPTIONS] Cmd...

Application Options:
  -e, --errors                      Show errors as they happen
  -w, --window-name=                Window name to wait for
  -p, --prepare-script=             Script to run to prepare a run
      --prepare-script-args=        Args to provide to the prepare script
  -r, --restore-script=             Script to run to restore after a run
      --restore-script-args=        Args to provide to the restore script
  -v, --keep-vm-caches              Don't free VM caches before executing
  -c, --class-name=                 Window class to use with xdotool instead of the the first Command
      --window-class-name=          Window class name to use with xdotool
  -s, --use-snap-run                Run command through snap run
  -f, --use-flatpak-run             Run command through flatpak run
  -d, --discard-snap-ns             Discard the snap namespace before running the snap
      --cmd-stdout=                 Log file for run command's stdout
      --silent                      Silence all program output
      --cmd-stderr=                 Log file for run command's stderr
  -j, --json                        Output results in JSON
  -o, --output-file=                A file to output the results (empty string means stdout)
      --no-window-wait              Don't wait for the window to appear, just run until the program exits
      --window-timeout=             Global timeout for waiting for windows to appear. Set to empty string to use no timeout (default: 60s)

Help Options:
  -h, --help                        Show this help message

[file command options]
          --file-regex=             Regular expression of files to return, if empty all files are returned
          --parent-dirs=            List of parent directories matching files must be underneath to match
          --program-regex=          Regular expression of programs whose file accesses should be returned
          --include-snapd-programs  Include snapd programs whose file accesses match in the list of files accessed
          --show-programs           Show programs that accessed the files

[file command arguments]
  Cmd:                              Command to run

analyze-snap subcommand

The analyze-snap subcommand will run a few different tests of the specified snap, mainly heuristics around guesses of what might be relevant to why a graphical snap is performing poorly. It takes a snap name, and will install that snap from the store (with an optional channel specification) if it is not already installed. It will make a backup of all the snap user data for that snap before executing tests, but this is not 100% foolproof, so it is suggested that you manually backup any sensitive data for the snap. The snap will also be removed and reinstalled multiple times, but any revisions of the snap that are inactive (i.e. old revisions) that exist at the time of running the command will be lost due to garbage collection by snapd when removing and reinstalling the snap.

Right now, the main assumption it makes is that most snaps that are XZ are slow, and that they would benefit from switching to LZO, so if the specified snap is using XZ, it will analyze the results of switching to XZ. Eventually, it would be great to extend it to do other sorts of performance/execution related analysis. If the snap is already LZO, then it skips the comparison and just displays the cold/hot statistics.

The subcomand currently doesn't obey all of the global options that etrace uses, but that should be fixed up soon.

Finally, note that since it executes the specified snap 40 times, with 20 of those executions "slow" worst case performance scenarios, it can take a decent chunk of time to finish, but just give it time and it will spit out results. A progress bar would be a great addition that I haven't added yet.

etrace analyze-snap usage:

Usage:
  etrace [OPTIONS] analyze-snap [analyze-snap-OPTIONS] Snap

Application Options:
  -e, --errors               Show errors as they happen
  -w, --window-name=         Window name to wait for
  -p, --prepare-script=      Script to run to prepare a run
      --prepare-script-args= Args to provide to the prepare script
  -r, --restore-script=      Script to run to restore after a run
      --restore-script-args= Args to provide to the restore script
  -v, --keep-vm-caches       Don't free VM caches before executing
  -c, --class-name=          Window class to use with xdotool instead of the the first Command
      --window-class-name=   Window class name to use with xdotool
  -s, --use-snap-run         Run command through snap run
  -f, --use-flatpak-run      Run command through flatpak run
  -d, --discard-snap-ns      Discard the snap namespace before running the snap
      --cmd-stdout=          Log file for run command's stdout
      --silent               Silence all program output
      --cmd-stderr=          Log file for run command's stderr
  -j, --json                 Output results in JSON
  -o, --output-file=         A file to output the results (empty string means stdout)
      --no-window-wait       Don't wait for the window to appear, just run until the program exits
      --window-timeout=      Global timeout for waiting for windows to appear. Set to empty string to use no timeout (default: 60s)

Help Options:
  -h, --help                 Show this help message

[analyze-snap command options]
          --channel=         Channel to install the snap from if not already installed

[analyze-snap command arguments]
  Snap:                      Snap to analyze

Examples

Example output measuring the time it takes for gnome-calculator snap to display a window :

$ ./etrace run -s -d gnome-calculator
Gdk-Message: 19:24:54.686: gnome-calculator: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.

33 exec calls during snap run:
     Start   Stop     Elapsed       Exec
     0       637604   637.604951ms  /usr/bin/snap
     10861   16162    5.300998ms    /sbin/apparmor_parser
     27100   32632    5.532026ms    /sbin/apparmor_parser
     37952   43672    5.7199ms      /snap/core/8442/usr/lib/snapd/snap-seccomp
     199319  624943   425.623178ms  snap-update-ns
     630534  635629   5.095005ms    snap-update-ns
     637604  643633   6.02889ms     /usr/lib/snapd/snap-exec
     643633  859514   215.881109ms  /snap/gnome-calculator/544/snap/command-chain/desktop-launch
     648627  651546   2.918958ms    /bin/date
     653303  658548   5.24497ms     /usr/bin/getent
     659688  664492   4.803895ms    /bin/mkdir
     665293  667890   2.596855ms    /bin/chmod
     669271  672246   2.974987ms    /usr/bin/md5sum
     673502  676505   3.002882ms    /bin/cat
     677770  680341   2.571105ms    /usr/bin/md5sum
     681612  684237   2.625942ms    /bin/cat
     685184  688700   3.516912ms    /bin/grep
     691617  703045   11.428833ms   /bin/mkdir
     703604  714510   10.905981ms   /bin/mkdir
     714978  726362   11.38401ms    /bin/mkdir
     729024  734812   5.788087ms    /snap/gnome-calculator/544/gnome-platform/usr/bin/xdg-user-dirs-update
     736660  746938   10.27894ms    /usr/bin/realpath
     748053  758188   10.13422ms    /usr/bin/realpath
     759251  768904   9.653091ms    /usr/bin/realpath
     769857  779485   9.628057ms    /usr/bin/realpath
     780469  790699   10.22911ms    /usr/bin/realpath
     791952  802161   10.209083ms   /usr/bin/realpath
     803193  813010   9.817123ms    /usr/bin/realpath
     813982  823803   9.820938ms    /usr/bin/realpath
     826356  837656   11.299133ms   /bin/mkdir
     838415  848245   9.829998ms    /bin/rm
     848959  859074   10.114908ms   /bin/ln
     859514  2063222  1.203707933s  /snap/gnome-calculator/544/usr/bin/gnome-calculator
Total time:  2.063222886s
Total startup time: 2.027564926s

You can also disable usage of strace within strace to just get the time it took to display a window:

$ ./etrace run -s -d -t gnome-calculator
Gdk-Message: 19:26:11.684: gnome-calculator: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.

Total startup time: 1.017437604s

Tracing what files are accessed by the jq snap:

$ ./etrace file --no-window-wait --cmd-stderr=/dev/null jq
3 files accessed during snap run:
     Filename                                              Size (bytes)
     /snap/jq/6/command-jq.wrapper                         322
     /snap/jq/6/meta/snap.yaml                             182
     /snap/jq/6/usr/lib/x86_64-linux-gnu/libonig.so.2.0.1  426840

Total startup time: 125.04791ms

Analyzing a snap (note that this example took about 15 minutes to execute on a decently powerful Ubuntu desktop):

$ etrace analyze-snap 1password
original snap size: 82.45 MiB
original compression format is xz
content snap slot dependencies: [gnome-3-28-1804 gtk-common-themes]
worst case performance:
        average time to display: 14.021772885s
        standard deviation for time to display: 598.600444ms
best case performance:
        average time to display: 1.096632064s
        standard deviation for time to display: 45.572462ms
worst case performance with LZO compression:
        average time to display: 4.692383384s
        standard deviation for time to display: 51.066194ms
        average time to display percent change: -66.54%
best case performance with LZO compression:
        average time to display: 1.110948092s
        standard deviation for time to display: 19.30841ms
        average time to display percent change: +1.31%
lzo snap size: 105.62 MiB (change of +28.10%)

Current Limitations

Currently, the file subcommand has a few limitations.

  1. We currently only measure files that are under $SNAP, ideally this should be controllable by regex specified with an option
  2. Due to 1, we only support measuring files accessed by snap apps, but this limitation should go away when we can specify what files to measure with an option.

The analyze-snap subcommand has the following limitations:

  1. None of the global options that are shared with exec and file are not yet understood/passed along.
  2. The output for analyze-snap isn't stable and will probably be adjusted
  3. The analyze-snap command can take a long time but doesn't convey at all how far along it is in the execution.

License

This project is licensed under the GPLv3. See LICENSE file for full license. Copyright 2019-2021 Canonical Ltd.

etrace's People

Contributors

anonymouse64 avatar bboozzoo avatar dependabot[bot] avatar renovate-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

etrace's Issues

support reinstalling content snaps with --reinstall snap too

We should support detecting content interface connections from snaps and reinstall those as well, since those can slow down snaps as well due to decompression by the kernel. The logic would look basically like:

if slot.Snap != "system" {
    snapshotSnap(slot.Snap)
    removeSnap(slot.Snap)
    snapsToInstall = append(snapsToInstall,slot.Snap)
}

interally combine file and exec subcommand common implementation

We currently have a lot of duplication of the implementation of many options that are shared between the exec and file subcommands. We should try to unify the implementation of these as much as possible, including the main loop of iterations and handling options.

Support snap aliases

Using snap aliases with snap run is currently not supported, observe:

$ snap install test-snapd-glxgears 
$ snap run test-snapd-glxgears
error: cannot find app "test-snapd-glxgears" in "test-snapd-glxgears"
$ snap alias test-snapd-glxgears.glxgears test-snapd-glxgears
error: cannot perform the following tasks:
- Setup manual alias "test-snapd-glxgears" => "glxgears" for snap "test-snapd-glxgears" (cannot enable alias "test-snapd-glxgears" for "test-snapd-glxgears", it conflicts with the command namespace of installed snap "test-snapd-glxgears")
$ snap alias test-snapd-glxgears.glxgears glxgears
Added:
  - test-snapd-glxgears.glxgears as glxgears
$ snap run glxgears
error: cannot find current revision for snap glxgears: readlink /snap/glxgears/current: no such file or directory

The only way to currently do this is to specify the /snap/bin/ program and omit --use-snap-run.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/go.yml
  • actions/setup-go v3
  • actions/checkout v2.4.0
.github/workflows/naming.yml
  • actions/checkout v2
.github/workflows/snap.yml
  • actions/checkout v2.4.0
  • snapcore/action-build v1.0.9
  • actions/upload-artifact v2
  • actions/download-artifact v2
gomod
go.mod
  • go 1.13
  • github.com/jessevdk/go-flags v1.4.1-0.20180927143258-7309ec74f752@7309ec74f752
  • github.com/snapcore/snapd v0.0.0-20210726143858-26a7ab7b6a92@26a7ab7b6a92
  • golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4@a5a99cb37ef4
  • gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15@41f04d3bba15

  • Check this box to trigger a request for Renovate to run again on this repository

error message should be smarter

When the command specified as input is unambiguously a snap command/snap name, we shouldn't require explicitly setting --use-snap-run, i.e. with only libreoffice installed I see this:

$ etrace exec --clean-snap-user-data --reinstall-snap --discard-snap-ns --no-trace libreoffice
cannot use --discard-snap-ns without --use-snap-run

analyze-snap should better identify running things through snap run

When a user has both a deb and a snap installed, i.e. has the following setup:

$  which -a vlc
/usr/bin/vlc
/bin/vlc
/snap/bin/vlc

etrace should do the right thing and figure out that since there are variants of the snap on $PATH that are not actually a snap, we need to pass explicitly --use-snap-run too.

etrace Fails when snap registers a url

Telegram Desktop registers a url / mime type so telegram URLS open with the app. If you use etrace to analyze the snap, you'll find a popup appears and the test hangs.

Steps to reproduce:

etrace analyze-snap telegram-desktop

Expect telegram to open.

What actually happens is a popup appears.

image

alan@robot:~$ etrace analyze-snap telegram-desktop
original snap size: 306.85 MiB
original compression format is lzo
content snap slot dependencies: [gtk-common-themes]
exit status 1

trace fails for standard-notes

alan@robot:~$ etrace analyze-snap standard-notes
[sudo] password for alan: 
original snap size: 63.93 MiB
original compression format is xz
content snap slot dependencies: [gnome-3-28-1804 gtk-common-themes]
exit status 1

No further information. I removed the snap before running this, as I did use it, but saved a snapshot and removed first, and it never gets past this.

etrace doesn't close antstream-arcade

alan@robot:~$ etrace analyze-snap antstream-arcade
[sudo] password for alan: 
original snap size: 280.74 MiB
original compression format is xz
content snap slot dependencies: []
exit status 1

The antstream-arcade window opens, and stays open.

Provide a quiet mode where nothing but the total startup time is displayed

Using both --cmd-stderr=/dev/null --cmd-stdout=/dev/null already helps but that's not enough as etrace itself can print msg on stderr. It would be great to have a way to only output the total startup time.

$ etrace exec -s -d -t --cmd-stderr=/dev/null --cmd-stdout=/dev/null vlc -n 5 
Total startup time: 2.552092291s
2021/03/30 17:08:18 xdotool.go:91: X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  113 (X_KillClient)
  Value in failed request:  0x440000a
  Serial number of failed request:  18
  Current serial number in output stream:  20

2021/03/30 17:08:18 main.go:120: 
Total startup time: 2.548430002s
2021/03/30 17:08:20 xdotool.go:91: X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  113 (X_KillClient)
  Value in failed request:  0x440000a
  Serial number of failed request:  18
  Current serial number in output stream:  20

2021/03/30 17:08:20 main.go:120: 
Total startup time: 2.554694062s

`etrace file --use-snap-run chromium` fails on Ubuntu 20.10

This is in a fully up-to-date groovy (Ubuntu 20.10) amd64 VM:

ubuntu@groovyvm:~$ etrace file --use-snap-run chromium
2020/10/23 21:34:34 xdotool.go:84: 
strace-log-merge: /tmp/file-trace438846678/strace.log: strace output not found
2020/10/23 21:34:34 file-tracing.go:296: 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x52ba47]

goroutine 1 [running]:
github.com/anonymouse64/etrace/internal/strace.(ExecvePaths).Display(0x0, 0x5dcaa0, 0xc0000ce000)
    /build/etrace/parts/etrace/src/internal/strace/file-tracing.go:173 +0x37
main.(cmdFile).Execute(0x6ea080, 0xc00005ed20, 0x0, 0x3, 0x0, 0x0)
    /build/etrace/parts/etrace/src/cmd/etrace/cmd_file.go:263 +0xfd0
github.com/jessevdk/go-flags.(Parser).ParseArgs(0xc00008b730, 0xc000010090, 0x3, 0x3, 0x0, 0x0, 0x0, 0x6, 0xc00007e380)
    /root/go/pkg/mod/github.com/jessevdk/[email protected]/parser.go:333 +0x8c3
github.com/jessevdk/go-flags.(Parser).Parse(...)
    /root/go/pkg/mod/github.com/jessevdk/[email protected]/parser.go:190
main.main()
    /build/etrace/parts/etrace/src/cmd/etrace/main.go:95 +0x19c

On the other hand, etrace exec chromium works as expected in the same VM.

analyze-snap should perhaps compare to non-snap packages

While analyze-snap is super useful for comparing the result of changing the compression algorithm from xz to lzo, there is another comparison which could be useful. Compare an xz/lzo snap with the non-snap package startup time. This shows the difference between the snap and non-snap package could highlight further debugging if necessary.

Perhaps optionally as:

etrace analyze-snap vlc --non-snap /usr/bin/vlc

I'd expect the same 20 runs of the application to be done after the xz/lzo runs.

more tests for tracing package

The tracing package currently is the most complicated part and has a minimal amount of tests, we should add more tests there and try to refactor it to be easier to follow. Specifically the regular expressions need a lot of tests to make sure they match what we expect them to match and that they don't match what we expect them to not match.

Provide an option to always render the startup time in seconds

Having to post process output like Total startup time: 1m10.027260157s is not great.
Would be really helpful to either provide an option to specify the time unit or force the time to always be returned in seconds.

e.g:

fmt.Fprintln(w, "Total startup time:", startup.Seconds())

make --delete-snap-user-data more user-friendly / automatic

We can actually make --delete-snap-user-data much more user-friendly by creating a snapshot before all iterations and then restoring it at the end after all iterations and deleting the snapshot. That means that during each run, we still don't have the data, but we also don't leave the user with a bunch of useless snapshots at the end that they have to dig through to understand and restore their data.

unable to trace intellij snap

Using etrace from edge channel.

alan@robot:~$ etrace analyze-snap intellij-idea-ultimate
unable to install snap intellij-idea-ultimate and analyze: exit status 1

I assume this is because it's a classic snap, because I can't analyze code or datagrip either, both classic.

Mention pros & cons against other tools used for measuring application startup times

There are pre-existing tools for doing same as what this does, albeit not so focused on getting single, and potentially misleading, number for application startup. First application window appearing isn't necessarily any indication that application is ready to interact with the user, alhtough that is as at least as relevant startup metric for the user, as the app window appearance.

XResponse tool was designed to measure X applications startup and other user interaction times: https://www.freedesktop.org/wiki/Software/xresponse/

Maemo version has several improvements on top of that: https://github.com/maemo-tools-old/xresponse

I think there was also some tool(s) that measured startup time user interaction timings using toolkit introspection / accessibility features.

PS. This could have picked a more original name. Just Googling "etrace github" returns many tools called etrace, and at least one of them (written decade ago) was even ptrace based like this is...

PPS. File tool should mention also how many times given file is opened/read. Sometimes apps redundantly parse files many times.

sometimes causes things to crash with VS code

Sometimes, when running large tests like the below script in a terminal window in VS code, VS code will eventually be crashed:

#!/bin/bash -ex

datadir=data-testrun-$RANDOM
mkdir $datadir

numAddtIterations=19

for s in gnome-calculator chromium supertuxkart libreoffice; do
    outFile=$datadir/$s-vanilla-startup-notrace.json

    if ! test -f "$outFile.done"; then
        ./etrace --additional-iterations=$numAddtIterations run \
            --prepare-script=prepare-snap.sh \
            --prepare-script-args=$s \
            --prepare-script-args=$HOME/git/etrace/snap-repository/vanilla/$s.snap \
            --output-file=$outFile \
            --no-trace \
            --use-snap-run \
            --discard-snap-ns \
            --json \
            $s

        touch "$outFile.done"
    fi
done

# silly ones that need to have a window name specified
for s in mari0 test-snapd-glxgears; do
    case $s in 
        mari0)
            WINDOW_NAME=Mari0;;
        test-snapd-glxgears)
            WINDOW_NAME=glxgears;;
    esac

    outFile=$datadir/$s-vanilla-startup-notrace.json

    if ! test -f "$outFile.done"; then
        ./etrace --additional-iterations=$numAddtIterations run \
            --prepare-script=prepare-snap.sh \
            --prepare-script-args=$s \
            --prepare-script-args=$HOME/git/etrace/snap-repository/vanilla/$s.snap \
            --window-name=$WINDOW_NAME \
            --output-file=$outFile \
            --no-trace \
            --use-snap-run \
            --discard-snap-ns \
            --json \
            $s

        touch "$outFile.done"
    fi    
done

Nothing in dmesg or system logs, snapd didn't crash and there was no weird tasks in snapd state either. The crash reported seems to have been triggered, but it didn't do anything, just skipped uploading a previous upload.

implement cwd and mount namespace/chroot tracking

Currently, if a program issues a syscall like this:

20563 1592353877.755357 symlink("some-link", "/home/user/snap/chromium/1193/.config/chromium/SingletonLock") = 0

then we don't correctly track that the resultant file created is $CWD/some-link, because we only see "some-link" in the syscall. There are a few other syscalls like this that work with the AT_FDCWD special value as well that we are not resolving properly again due to the fact that we don't track current working directory changes.

The code to do this is not hard, we would probably just have to have a regexp that catches the chdir syscall and keep track of it as the loop progress through every syscall, and then also have another specific regexp that matches the set of syscalls that use this pattern as well as any syscall that uses AT_FDCWD with a non-absolute path as another syscall argument, and then do the replacement.

There's a related and similar problem about tracking mount namespace changes and chroots where we want to follow the changes into the mount namespace to see that a strictly confined snap accessing /lib/x86_64-linux-gnu/libc-2.27.so is really accessing the base snap's file i.e. /snap/core18/current/lib/x86_64-linux-gnu/libc-2.27.so

fail with nicer message when no window session is available

Currently, we verify that the window is X11, but if you are running headless without any session, you see a confusing message like this:

error: graphical session type  is unsupported, only x11 is supported

notice the double spaces between type and is

Fails to start: `could not set process exec attr to unconfined: write /proc/self/attr/exec: invalid argument`

Version

$ git rev-parse HEAD       
d97d3d1571dc7c21cb673321ec90a27baa37dc72
$ git log -n1
commit d97d3d1571dc7c21cb673321ec90a27baa37dc72 (HEAD -> master, origin/master, origin/HEAD)
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Mar 1 03:03:13 2022 +0000

    build(deps): bump actions/setup-go from 2.2.0 to 3
    
    Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2.2.0 to 3.
    - [Release notes](https://github.com/actions/setup-go/releases)
    - [Commits](https://github.com/actions/setup-go/compare/v2.2.0...v3)
    
    ---
    updated-dependencies:
    - dependency-name: actions/setup-go
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>

Log

$ /home/mbana/go/bin/etrace run -s -d gnome-calculator
2023/02/10 17:25:18 could not set process exec attr to unconfined: write /proc/self/attr/exec: invalid argument

System Information

$ cat /etc/os-release
NAME="Fedora Linux"
VERSION="37 (Workstation Edition)"
ID=fedora
VERSION_ID=37
VERSION_CODENAME=""
PLATFORM_ID="platform:f37"
PRETTY_NAME="Fedora Linux 37 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:37"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f37/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=37
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=37
SUPPORT_END=2023-11-14
VARIANT="Workstation Edition"
VARIANT_ID=workstation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.