We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa8ff47 commit 355e995Copy full SHA for 355e995
internal/lib/query.go
@@ -98,13 +98,21 @@ func runQueryExec(query string, history bool) bool {
98
99
// Executes a query as a process to profile.
100
func runQueryProfile(pid string, history bool) bool {
101
+ var success = true
102
+
103
slog.Debug("Profiling pid", "pid", pid)
104
105
pidInt, err := strconv.Atoi(pid)
106
e(err)
- AddResult(pid, runProfile(pidInt), history)
107
- return true
108
+ if _, err := os.FindProcess(pidInt); err != nil {
109
+ AddResult(pid, runProfile(pidInt), history)
110
+ } else {
111
+ slog.Error("Pid not found", "pid", pid)
112
+ success = false
113
+ }
114
115
+ return success
116
}
117
118
// Reads standard input for results.
0 commit comments