Lines Matching full:cmdline
120 // Normalize cmdline in place. Stores new beginning of string in *cmdline_ptr.
124 char* cmdline = *cmdline_ptr; in NormalizeCmdLine() local
125 char* first_arg = static_cast<char*>(memchr(cmdline, '\0', size)); in NormalizeCmdLine()
132 char* first_at = static_cast<char*>(memchr(cmdline, '@', size)); in NormalizeCmdLine()
138 memrchr(cmdline, '/', static_cast<size_t>(first_arg - cmdline))); in NormalizeCmdLine()
140 start = cmdline; in NormalizeCmdLine()
155 std::string cmdline = cmdlines[i]; // mutable copy in NormalizeCmdlines() local
157 cmdline.resize(cmdline.size() + 1, '\0'); in NormalizeCmdlines()
158 char* cmdline_cstr = &(cmdline[0]); in NormalizeCmdlines()
159 ssize_t size = NormalizeCmdLine(&cmdline_cstr, cmdline.size()); in NormalizeCmdlines()
161 PERFETTO_PLOG("Failed to normalize cmdline %s. Stopping the parse.", in NormalizeCmdlines()
174 std::string filename = "/proc/" + std::to_string(pid) + "/cmdline"; in GetCmdlineForPID()
180 char cmdline[512]; in GetCmdlineForPID() local
181 const size_t max_read_size = sizeof(cmdline) - 1; in GetCmdlineForPID()
182 ssize_t rd = read(*fd, cmdline, max_read_size); in GetCmdlineForPID()
189 PERFETTO_DLOG("Empty cmdline for %" PRIdMAX ". Skipping.", in GetCmdlineForPID()
194 // In some buggy kernels (before http://bit.ly/37R7qwL) /proc/pid/cmdline is in GetCmdlineForPID()
198 if (rd_u >= max_read_size && memchr(cmdline, '\0', rd_u) == nullptr) { in GetCmdlineForPID()
200 PERFETTO_DLOG("Overflow reading cmdline for %" PRIdMAX, in GetCmdlineForPID()
206 cmdline[rd] = '\0'; in GetCmdlineForPID()
207 char* cmdline_start = cmdline; in GetCmdlineForPID()
221 snprintf(filename_buf, sizeof(filename_buf), "/proc/%d/%s", pid, "cmdline"); in FindAllProfilablePids()
237 for (const std::string& cmdline : cmdlines) { in FindPidsForCmdlines() local
238 if (process_cmdline == cmdline) in FindPidsForCmdlines()
250 std::string cmdline; in FindPidsForCmdlinePatterns() local
251 if (!glob_aware::ReadProcCmdlineForPID(pid, &cmdline)) in FindPidsForCmdlinePatterns()
254 glob_aware::FindBinaryName(cmdline.c_str(), cmdline.size()); in FindPidsForCmdlinePatterns()
257 if (glob_aware::MatchGlobPattern(pattern.c_str(), cmdline.c_str(), in FindPidsForCmdlinePatterns()