Skip to content

Commit

Permalink
delete "/bin"
Browse files Browse the repository at this point in the history
  • Loading branch information
aoliaoaoaojiao committed Feb 3, 2023
1 parent 2f37c92 commit 356c0b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/perfmonUtil/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import (
)

func getStatOnPid(client *adb.Device, pid string) (stat *entity.ProcessStat, err error) {
lines, err := client.OpenShell(fmt.Sprintf("/bin/cat /proc/%s/stat", pid))
lines, err := client.OpenShell(fmt.Sprintf("cat /proc/%s/stat", pid))
if err != nil {
return nil, fmt.Errorf("exec command erro : " + fmt.Sprintf("/bin/cat /proc/%s/stat", pid))
return nil, fmt.Errorf("exec command erro : " + fmt.Sprintf("cat /proc/%s/stat", pid))
}
data, err := ioutil.ReadAll(lines)
if err != nil {
Expand Down Expand Up @@ -67,9 +67,9 @@ func GetPidOnPackageName(client *adb.Device, appName string) (pid string, err er
}

func getStatusOnPid(client *adb.Device, pid string) (status *entity.ProcessStatus, err error) {
lines, err1 := client.OpenShell(fmt.Sprintf("/bin/cat /proc/%s/status", pid))
lines, err1 := client.OpenShell(fmt.Sprintf("cat /proc/%s/status", pid))
if err1 != nil {
return status, fmt.Errorf("exec command erro : " + fmt.Sprintf("/bin/cat /proc/%s/status", pid))
return status, fmt.Errorf("exec command erro : " + fmt.Sprintf("cat /proc/%s/status", pid))
}
data, err := ioutil.ReadAll(lines)
if err != nil {
Expand Down
10 changes: 5 additions & 5 deletions src/perfmonUtil/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func GetSystemStats(client *adb.Device, perfOptions entity.PerfOption) (stats *e
}

func getMemInfo(client *adb.Device, stats *entity.SystemInfo) (err error) {
lines, err := client.OpenShell("/bin/cat /proc/meminfo")
lines, err := client.OpenShell("cat /proc/meminfo")
if err != nil {
return
}
Expand Down Expand Up @@ -102,10 +102,10 @@ func getMemInfo(client *adb.Device, stats *entity.SystemInfo) (err error) {

func getInterfaces(client *adb.Device, stats *entity.SystemInfo) (err error) {
var lines io.ReadCloser
lines, err = client.OpenShell("/bin/ip -o addr")
lines, err = client.OpenShell("ip -o addr")
if err != nil {
// try /sbin/ip
lines, err = client.OpenShell("/sbin/ip -o addr")
lines, err = client.OpenShell("/bin/ip -o addr")
if err != nil {
return
}
Expand Down Expand Up @@ -145,7 +145,7 @@ func getInterfaces(client *adb.Device, stats *entity.SystemInfo) (err error) {
}

func getInterfaceInfo(client *adb.Device, stats *entity.SystemInfo) (err error) {
lines, err := client.OpenShell("/bin/cat /proc/net/dev")
lines, err := client.OpenShell("cat /proc/net/dev")
if err != nil {
return
}
Expand Down Expand Up @@ -216,7 +216,7 @@ var preCPU entity.SystemCpuRaw
var preCPUMap map[string]entity.SystemCpuRaw

func getCPU(client *adb.Device, stats *entity.SystemInfo) (err error) {
lines, err := client.OpenShell("/bin/cat /proc/stat")
lines, err := client.OpenShell("cat /proc/stat")
if err != nil {
return
}
Expand Down

0 comments on commit 356c0b9

Please sign in to comment.