为什么 strace 会改变命令行为?

为什么 strace 会改变命令行为?

我正在尝试使用PICpgm对通过 GPIO 连接的 Microchip 进行编程。我在 Pi 4B 上运行 Raspbian Buster。以 root 身份运行,此命令返回无错误,但不会打印任何有用的内容。如果我运行相同的命令,strace它会正常工作。这可以解释什么? strace增加了巨大的 CPU 开销,所以我想找到一种方法来解决这个问题。

# picpgm -r

==================================================================
PICPgm 2.9.3.1
PIC Development Programmer, http://picpgm.picprojects.net
Copyright 2002-2018 Christian Stadler ([email protected])
built on Jun 17 2018, 09:26:06
==================================================================

Autodetecting Programmer ...
GPIO: access via /sys/class/gpio
Programmer: GPIO Programmer (Raspberry Pi)
            at GPIO

Autodetecting PIC ...

finished in 2.0 seconds!
# strace -o /dev/null picpgm -r

==================================================================
PICPgm 2.9.3.1
PIC Development Programmer, http://picpgm.picprojects.net
Copyright 2002-2018 Christian Stadler ([email protected])
built on Jun 17 2018, 09:26:06
==================================================================

Autodetecting Programmer ...
GPIO: access via /sys/class/gpio
Programmer: GPIO Programmer (Raspberry Pi)
            at GPIO

Autodetecting PIC ...

PIC name:    PIC18F67J60
Device ID:   0x1F23
Flash:       128 kByte
EEPROM:      0 Byte


finished in 3.0 seconds!

相关内容