Lines Matching refs:cmdline
50 PERFETTO_ELOG("Failed to concatenate cmdline file.");
52 PERFETTO_ELOG("Overflow when concatenating cmdline file.");
60 bool NormalizeCmdLine(char* cmdline, size_t size, std::string* name) {
61 char* first_arg = static_cast<char*>(memchr(cmdline, '\0', size));
63 PERFETTO_DLOG("Overflow reading cmdline");
69 char* first_at = static_cast<char*>(memchr(cmdline, '@', size));
75 memrchr(cmdline, '/', static_cast<size_t>(first_arg - cmdline)));
78 PERFETTO_DLOG("cmdline ends in /");
82 start = cmdline;
95 for (std::string cmdline : cmdlines) {
97 cmdline.resize(cmdline.size() + 1, '\0');
99 if (!NormalizeCmdLine(&(cmdline[0]), cmdline.size(), &normalized)) {
100 PERFETTO_ELOG("Failed to normalize cmdline %s. Skipping.",
101 cmdline.c_str());
113 std::string filename = "/proc/" + std::to_string(pid) + "/cmdline";
119 char cmdline[512];
120 ssize_t rd = read(*fd, cmdline, sizeof(cmdline) - 1);
127 PERFETTO_DLOG("Empty cmdline for %" PRIdMAX ". Skipping.",
133 if (memchr(cmdline, '\0', static_cast<size_t>(rd)) == nullptr) {
134 PERFETTO_DLOG("Overflow reading cmdline for %" PRIdMAX,
140 cmdline[rd] = '\0';
141 return NormalizeCmdLine(cmdline, static_cast<size_t>(rd), name);
150 if (!GetProcFile(pid, "cmdline", filename_buf, sizeof(filename_buf)))
167 for (const std::string& cmdline : cmdlines) {
168 if (process_cmdline == cmdline)