首页 > 其他分享 >strace lsscsi(busybox)

strace lsscsi(busybox)

时间:2024-02-18 21:22:41浏览次数:29  
标签:busybox 4read strace 0close LARGEFILE RDONLY 0openat FDCWD lsscsi

execve("/system/xbin/lsscsi", ["lsscsi"], 0x7fcdeb06c0 /* 24 vars *//data/local/tmp/strace: [ Process PID=32427 runs in 32 bit mode. ]
/data/local/tmp/strace: WARNING: Proper structure decoding for this personality is not supported, please consider building strace with mpers support enabled.
) = 0
set_tid_address(0x1560b0)               = 32427
set_tls(0x1562ec)                       = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf6f02000
madvise(0xf6f02000, 8192, MADV_MERGEABLE) = -1 EINVAL (Invalid argument)
sigaltstack({ss_sp=0xf6f02000, ss_flags=0x2000 /* SS_??? */, ss_size=18428009392004661248}, NULL) = 0
openat(AT_FDCWD, "/dev/__properties__", O_RDONLY|O_LARGEFILE|O_NOFOLLOW|O_CLOEXEC) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
fstat64(3, 0xffbd7030)                  = 0
mmap2(NULL, 4780, PROT_READ, MAP_SHARED, 3, 0) = -1 ENODEV (No such device)
close(3)                                = 0
mprotect(0x150000, 16384, PROT_READ)    = 0
brk(NULL)                               = 0x84a000
mmap2(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf6e02000
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, 0xf6e02000, 1048576, "libc_malloc") = 0
munmap(0xf6e02000, 1048576)             = 0
mmap2(NULL, 2093056, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf6d03000
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, 0xf6d03000, 2093056, "libc_malloc") = 0
munmap(0xf6d03000, 1036288)             = 0
munmap(0xf6f00000, 8192)                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf6f01000
mprotect(0xf6f01000, 4096, PROT_READ)   = 0
openat(AT_FDCWD, "/proc/stat", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, 0xffbd6e58)                  = 0
mmap2(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf6d00000
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, 0xf6d00000, 1048576, "libc_malloc") = 0
mprotect(0xf6f01000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xf6f01000, 4096, PROT_READ)   = 0
read(3, "cpu  14894954 2971036 11984155 1"..., 1024) = 1024
read(3, "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "..., 1024) = 1024
read(3, " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"..., 1024) = 693
read(3, "", 1024)                       = 0
close(3)                                = 0
mprotect(0xf6f01000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xf6f01000, 4096, PROT_READ)   = 0
chdir("/sys/bus/scsi/devices")          = 0
openat(AT_FDCWD, ".", O_RDONLY|O_LARGEFILE|O_DIRECTORY) = 3
getdents64(3, /* 13 entries */, 4200)   = 400
chdir("0:0:0:5")                        = 0
openat(AT_FDCWD, "vendor", O_RDONLY|O_LARGEFILE) = 4
read(4, "SAMSUNG \n", 254)              = 9
read(4, "", 245)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "type", O_RDONLY|O_LARGEFILE) = 4
read(4, "0\n", 246)                     = 2
read(4, "", 244)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "model", O_RDONLY|O_LARGEFILE) = 4
read(4, "KM8V7001JM-B810 \n", 244)      = 17
read(4, "", 227)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "rev", O_RDONLY|O_LARGEFILE) = 4
read(4, "0900\n", 228)                  = 5
read(4, "", 223)                        = 0
close(4)                                = 0
fstat64(1, 0xffbd68f0)                  = 0
mprotect(0xf6f01000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xf6f01000, 4096, PROT_READ)   = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(1, "[0:0:0:5]\tdisk\tSAMSUNG\tKM8V7001J"..., 44[0:0:0:5]  disk    SAMSUNG KM8V7001JM-B810 0900
) = 44
chdir("/sys/bus/scsi/devices")          = 0
chdir("0:0:0:3")                        = 0
openat(AT_FDCWD, "vendor", O_RDONLY|O_LARGEFILE) = 4
read(4, "SAMSUNG \n", 254)              = 9
read(4, "", 245)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "type", O_RDONLY|O_LARGEFILE) = 4
read(4, "0\n", 246)                     = 2
read(4, "", 244)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "model", O_RDONLY|O_LARGEFILE) = 4
read(4, "KM8V7001JM-B810 \n", 244)      = 17
read(4, "", 227)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "rev", O_RDONLY|O_LARGEFILE) = 4
read(4, "0900\n", 228)                  = 5
read(4, "", 223)                        = 0
close(4)                                = 0
write(1, "[0:0:0:3]\tdisk\tSAMSUNG\tKM8V7001J"..., 44[0:0:0:3]  disk    SAMSUNG KM8V7001JM-B810 0900
) = 44
chdir("/sys/bus/scsi/devices")          = 0
chdir("0:0:0:1")                        = 0
openat(AT_FDCWD, "vendor", O_RDONLY|O_LARGEFILE) = 4
read(4, "SAMSUNG \n", 254)              = 9
read(4, "", 245)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "type", O_RDONLY|O_LARGEFILE) = 4
read(4, "0\n", 246)                     = 2
read(4, "", 244)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "model", O_RDONLY|O_LARGEFILE) = 4
read(4, "KM8V7001JM-B810 \n", 244)      = 17
read(4, "", 227)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "rev", O_RDONLY|O_LARGEFILE) = 4
read(4, "0900\n", 228)                  = 5
read(4, "", 223)                        = 0
close(4)                                = 0
write(1, "[0:0:0:1]\tdisk\tSAMSUNG\tKM8V7001J"..., 44[0:0:0:1]  disk    SAMSUNG KM8V7001JM-B810 0900
) = 44
chdir("/sys/bus/scsi/devices")          = 0
chdir("0:0:0:49488")                    = 0
openat(AT_FDCWD, "vendor", O_RDONLY|O_LARGEFILE) = 4
read(4, "SAMSUNG \n", 254)              = 9
read(4, "", 245)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "type", O_RDONLY|O_LARGEFILE) = 4
read(4, "30\n", 246)                    = 3
read(4, "", 243)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "model", O_RDONLY|O_LARGEFILE) = 4
read(4, "KM8V7001JM-B810 \n", 243)      = 17
read(4, "", 226)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "rev", O_RDONLY|O_LARGEFILE) = 4
read(4, "0900\n", 227)                  = 5
read(4, "", 222)                        = 0
close(4)                                = 0
write(1, "[0:0:0:49488]\twlun\tSAMSUNG\tKM8V7"..., 48[0:0:0:49488]      wlun    SAMSUNG KM8V7001JM-B810 0900
) = 48
chdir("/sys/bus/scsi/devices")          = 0
chdir("0:0:0:49476")                    = 0
openat(AT_FDCWD, "vendor", O_RDONLY|O_LARGEFILE) = 4
read(4, "SAMSUNG \n", 254)              = 9
read(4, "", 245)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "type", O_RDONLY|O_LARGEFILE) = 4
read(4, "30\n", 246)                    = 3
read(4, "", 243)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "model", O_RDONLY|O_LARGEFILE) = 4
read(4, "KM8V7001JM-B810 \n", 243)      = 17
read(4, "", 226)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "rev", O_RDONLY|O_LARGEFILE) = 4
read(4, "0900\n", 227)                  = 5
read(4, "", 222)                        = 0
close(4)                                = 0
write(1, "[0:0:0:49476]\twlun\tSAMSUNG\tKM8V7"..., 48[0:0:0:49476]      wlun    SAMSUNG KM8V7001JM-B810 0900
) = 48
chdir("/sys/bus/scsi/devices")          = 0
chdir("0:0:0:49456")                    = 0
openat(AT_FDCWD, "vendor", O_RDONLY|O_LARGEFILE) = 4
read(4, "SAMSUNG \n", 254)              = 9
read(4, "", 245)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "type", O_RDONLY|O_LARGEFILE) = 4
read(4, "30\n", 246)                    = 3
read(4, "", 243)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "model", O_RDONLY|O_LARGEFILE) = 4
read(4, "KM8V7001JM-B810 \n", 243)      = 17
read(4, "", 226)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "rev", O_RDONLY|O_LARGEFILE) = 4
read(4, "0900\n", 227)                  = 5
read(4, "", 222)                        = 0
close(4)                                = 0
write(1, "[0:0:0:49456]\twlun\tSAMSUNG\tKM8V7"..., 48[0:0:0:49456]      wlun    SAMSUNG KM8V7001JM-B810 0900
) = 48
chdir("/sys/bus/scsi/devices")          = 0
chdir("0:0:0:4")                        = 0
openat(AT_FDCWD, "vendor", O_RDONLY|O_LARGEFILE) = 4
read(4, "SAMSUNG \n", 254)              = 9
read(4, "", 245)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "type", O_RDONLY|O_LARGEFILE) = 4
read(4, "0\n", 246)                     = 2
read(4, "", 244)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "model", O_RDONLY|O_LARGEFILE) = 4
read(4, "KM8V7001JM-B810 \n", 244)      = 17
read(4, "", 227)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "rev", O_RDONLY|O_LARGEFILE) = 4
read(4, "0900\n", 228)                  = 5
read(4, "", 223)                        = 0
close(4)                                = 0
write(1, "[0:0:0:4]\tdisk\tSAMSUNG\tKM8V7001J"..., 44[0:0:0:4]  disk    SAMSUNG KM8V7001JM-B810 0900
) = 44
chdir("/sys/bus/scsi/devices")          = 0
chdir("0:0:0:2")                        = 0
openat(AT_FDCWD, "vendor", O_RDONLY|O_LARGEFILE) = 4
read(4, "SAMSUNG \n", 254)              = 9
read(4, "", 245)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "type", O_RDONLY|O_LARGEFILE) = 4
read(4, "0\n", 246)                     = 2
read(4, "", 244)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "model", O_RDONLY|O_LARGEFILE) = 4
read(4, "KM8V7001JM-B810 \n", 244)      = 17
read(4, "", 227)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "rev", O_RDONLY|O_LARGEFILE) = 4
read(4, "0900\n", 228)                  = 5
read(4, "", 223)                        = 0
close(4)                                = 0
write(1, "[0:0:0:2]\tdisk\tSAMSUNG\tKM8V7001J"..., 44[0:0:0:2]  disk    SAMSUNG KM8V7001JM-B810 0900
) = 44
chdir("/sys/bus/scsi/devices")          = 0
chdir("0:0:0:0")                        = 0
openat(AT_FDCWD, "vendor", O_RDONLY|O_LARGEFILE) = 4
read(4, "SAMSUNG \n", 254)              = 9
read(4, "", 245)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "type", O_RDONLY|O_LARGEFILE) = 4
read(4, "0\n", 246)                     = 2
read(4, "", 244)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "model", O_RDONLY|O_LARGEFILE) = 4
read(4, "KM8V7001JM-B810 \n", 244)      = 17
read(4, "", 227)                        = 0
close(4)                                = 0
openat(AT_FDCWD, "rev", O_RDONLY|O_LARGEFILE) = 4
read(4, "0900\n", 228)                  = 5
read(4, "", 223)                        = 0
close(4)                                = 0
write(1, "[0:0:0:0]\tdisk\tSAMSUNG\tKM8V7001J"..., 44[0:0:0:0]  disk    SAMSUNG KM8V7001JM-B810 0900
) = 44
chdir("/sys/bus/scsi/devices")          = 0
getdents64(3, /* 0 entries */, 4200)    = 0
mprotect(0xf6f01000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xf6f01000, 4096, PROT_READ)   = 0
mprotect(0xf6f01000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xf6f01000, 4096, PROT_READ)   = 0
munmap(0xf6f01000, 4096)                = 0
exit_group(0)                           = ?
+++ exited with 0 +++

 

:/ # lsscsi


[0:0:0:5]       disk    SAMSUNG KM8V7001JM-B810 0900
[0:0:0:3]       disk    SAMSUNG KM8V7001JM-B810 0900
[0:0:0:1]       disk    SAMSUNG KM8V7001JM-B810 0900
[0:0:0:49488]   wlun    SAMSUNG KM8V7001JM-B810 0900
[0:0:0:49476]   wlun    SAMSUNG KM8V7001JM-B810 0900
[0:0:0:49456]   wlun    SAMSUNG KM8V7001JM-B810 0900
[0:0:0:4]       disk    SAMSUNG KM8V7001JM-B810 0900
[0:0:0:2]       disk    SAMSUNG KM8V7001JM-B810 0900
[0:0:0:0]       disk    SAMSUNG KM8V7001JM-B810 0900

 

没有列出最后一列主设备节点名称,不过可以通过/sys/bus/scsi/devices目录里的信息看到

标签:busybox,4read,strace,0close,LARGEFILE,RDONLY,0openat,FDCWD,lsscsi
From: https://www.cnblogs.com/hhdom/p/18019972

相关文章

  • strace df -h
    /proc/self/fd报告进程打开的文件。每个条目都是一个“神奇”的符号链接,其名称是文件描述符,目标是打开的文件。它的神奇之处在于,链接实际上指向文件本身,即使通过调用获得的文件名readlink不是有效的文件名,例如,对于没有名称的文件(例如匿名管道),也会发生这种情况和套接字),并删除文件。......
  • 安卓 adb shell 使用strace
    https://stackoverflow.com/questions/34762544/strace-in-androidhttp://forum.xda-developers.com/showthread.php?t=2516002这个链接里边的下载链接改变内容了,可能域名过期了 https://source.android.com/docs/core/tests/debug/strace?hl=zh-cnmmma-j6external/strace......
  • linux调试工具strace,gdb
    strace用于跟踪系统调用和信号。strace是一个集诊断、调试、统计于一体的工具,我们可以使用strace跟踪程序的系统调用和信号传递分析程序,以解决问题或了解程序工作过程。当然strace与专业的调试工具比如说gdb之类的是没法相比的,因为它不是一个专业的调试器。strace最简......
  • 使用strace将重定向一个已经运行进程的输出
    在Linux上,可以使用以下命令来重定向一个已经运行的进程的输出:首先,找到要重定向输出的进程的PID(进程号)。可以使用命令 ps 或 top 来查看正在运行的进程和它们的PID。使用命令 strace-pPID-s100-ewrite 来跟踪进程的输出。这将列出进程在标准输出上写入的内容......
  • 4412 设备树 qt busybox , ctrl+c 无法终止 程序
    问题: 在系统中,ctrl+c无法终止程序。背景: 软件:迅为网盘设备树镜像。硬件:迅为4412板卡。  网上的截图:   我自己的改动如下;     结果显示: ......
  • OpenWRT集成busybox配置项的流程
    OpenWRT集成busybox配置项的流程来源 https://www.openwrt.pro/post-613.html1、研究背景  我们在开发的过程中可能需要移植OpenWRT上没有的软件包,而这些软件包又比较特殊。例如,像busybox那样自带kconfig配置文件供生成菜单配置界面的软件包。我们可以直接在这个软件包根目......
  • ubuntu18.04.6 配置Busybox make -C buildroot busybox-menuconfig 遇到提示LD_LIBR
     可以先在终端执行下面命令让LD_LIBRARY_PATH变量的内容变为空白 然后再继续,这时会提示安装g++ 输入sudoapt-getinstallg++又提示权限不够,那就在make命令的前面加上sudo即可: 这样busybox的界面就会出现:  ......
  • 掌握这些,轻松管理BusyBox:如何交叉编译和集成BusyBox
    在嵌入式系统中,由于设备的资源限制,需要开发人员寻找一种轻量、小型且使用广泛的工具集。而BusyBox就是这样一个在嵌入式系统中非常实用的工具集。本文将介绍如何在Ubuntu22.04平台上使用交叉编译器编译BusyBox,并将其集成到嵌入式系统中。什么是BusyBox工具集?BusyBox是......
  • 掌握这些,轻松管理BusyBox:inittab文件的配置和作用解析
    BusyBox是一个轻量级的开源工具箱,其中包含了许多标准的Unix工具,例如 sh、ls、cp、sed、awk、grep 等,同时它也支持大多数关键的系统功能,例如自启动、进程管理、启动脚本等等。而 inittab 文件则是BusyBox中的一个重要文件,掌握了 inittab 文件的作用及如何配置有助于更好......
  • 基于Busybox的ifup/ifdown网络配置
     如何在基于Busybox的文件系统,自动进行网络配置?通过ifup/ifdown,从/etc/network/interfaces获取配置,是一种常见的方式。下面从Buildroot配置ifupdown脚本、ifup/ifdown工作机制、/etc/network/interfaces分别简单记录。1Buildroot启动网络脚本Buildroot配置ifupdownscripts,可......