MCPcopy Create free account
hub / github.com/apache/impala / ListThreads

Function ListThreads

be/src/kudu/util/debug-util.cc:521–543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

519}
520
521Status ListThreads(vector<pid_t> *tids) {
522#ifndef __linux__
523 return Status::NotSupported("unable to list threads on this platform");
524#else
525 DIR *dir = opendir("/proc/self/task/");
526 if (dir == NULL) {
527 return Status::IOError("failed to open task dir", ErrnoToString(errno), errno);
528 }
529 struct dirent *d;
530 while ((d = readdir(dir)) != NULL) {
531 if (d->d_name[0] != '.') {
532 uint32_t tid;
533 if (!safe_strtou32(d->d_name, &tid)) {
534 LOG(WARNING) << "bad tid found in procfs: " << d->d_name;
535 continue;
536 }
537 tids->push_back(tid);
538 }
539 }
540 closedir(dir);
541 return Status::OK();
542#endif // __linux__
543}
544
545string GetStackTrace() {
546 string s;

Callers 2

TEST_FFunction · 0.85
SnapshotAllStacksMethod · 0.85

Calls 5

NotSupportedFunction · 0.85
ErrnoToStringFunction · 0.85
OKFunction · 0.85
push_backMethod · 0.80
IOErrorFunction · 0.70

Tested by 1

TEST_FFunction · 0.68