LINUX.ORG.RU

История изменений

Исправление tsmx, (текущая версия) :

execve("./hwmon_logger", ["./hwmon_logger", "/dev/stdout", "amdgpu", "temp1_input"], 0x7fffecd2c4f8 /* 34 vars */) = 0
brk(NULL)                               = 0x556922eb5000

[ обрезано ]

openat(AT_FDCWD, "/sys/class/hwmon", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
fstat(3, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
getdents64(3, /* 9 entries */, 32768)   = 272
openat(AT_FDCWD, "/sys/class/hwmon/hwmon6/name", O_RDONLY) = 4
read(4, "iwlwifi_1\n", 8191)            = 10
close(4)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon4/name", O_RDONLY) = 4
read(4, "k10temp\n", 8191)              = 8
close(4)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon2/name", O_RDONLY) = 4
read(4, "AC\n", 8191)                   = 3
close(4)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon0/name", O_RDONLY) = 4
read(4, "nvme\n", 8191)                 = 5
close(4)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon5/name", O_RDONLY) = 4
read(4, "BAT0\n", 8191)                 = 5
close(4)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon3/name", O_RDONLY) = 4
read(4, "thinkpad\n", 8191)             = 9
close(4)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/name", O_RDONLY) = 4
read(4, "amdgpu\n", 8191)               = 7
close(4)                                = 0
close(3)                                = 0
write(2, "/sys/class/hwmon/hwmon1/temp1_in"..., 35) = 35
write(2, "\n", 1)                       = 1
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
fstat(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = -1 EPIPE (Broken pipe)
--- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=44980, si_uid=1000} ---
+++ killed by SIGPIPE +++

Вот это прикол. А где вообще read?

Исходная версия tsmx, :

execve("./hwmon_logger", ["./hwmon_logger", "/dev/stdout", "amdgpu", "temp1_input"], 0x7fffecd2c4f8 /* 34 vars */) = 0
brk(NULL)                               = 0x556922eb5000

[ обрезано ]

openat(AT_FDCWD, "/sys/class/hwmon", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
fstat(3, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
getdents64(3, /* 9 entries */, 32768)   = 272
openat(AT_FDCWD, "/sys/class/hwmon/hwmon6/name", O_RDONLY) = 4
read(4, "iwlwifi_1\n", 8191)            = 10
close(4)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon4/name", O_RDONLY) = 4
read(4, "k10temp\n", 8191)              = 8
close(4)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon2/name", O_RDONLY) = 4
read(4, "AC\n", 8191)                   = 3
close(4)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon0/name", O_RDONLY) = 4
read(4, "nvme\n", 8191)                 = 5
close(4)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon5/name", O_RDONLY) = 4
read(4, "BAT0\n", 8191)                 = 5
close(4)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon3/name", O_RDONLY) = 4
read(4, "thinkpad\n", 8191)             = 9
close(4)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/name", O_RDONLY) = 4
read(4, "amdgpu\n", 8191)               = 7
close(4)                                = 0
close(3)                                = 0
write(2, "/sys/class/hwmon/hwmon1/temp1_in"..., 35) = 35
write(2, "\n", 1)                       = 1
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
fstat(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = 2
close(3)                                = 0
openat(AT_FDCWD, "/sys/class/hwmon/hwmon1/temp1_input", O_RDONLY) = 3
write(1, "0\n", 2)                      = -1 EPIPE (Broken pipe)
--- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=44980, si_uid=1000} ---
+++ killed by SIGPIPE +++

Вот это прикол. А почему write?