1 | /* |
2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
3 | * All rights reserved. |
4 | * |
5 | * This source code is licensed under the BSD-style license found in the |
6 | * LICENSE file in the root directory of this source tree. |
7 | */ |
8 | |
9 | #pragma once |
10 | |
11 | #include <cstdint> |
12 | #include <string> |
13 | #include <utility> |
14 | #include <vector> |
15 | |
16 | namespace libkineto { |
17 | |
18 | int32_t systemThreadId(); |
19 | int32_t threadId(); |
20 | bool setThreadName(const std::string& name); |
21 | std::string getThreadName(); |
22 | |
23 | int32_t processId(); |
24 | std::string processName(int32_t pid); |
25 | |
26 | // Return a list of pids and process names for the current process |
27 | // and its parents. |
28 | std::vector<std::pair<int32_t, std::string>> pidCommandPairsOfAncestors(); |
29 | |
30 | } // namespace libkineto |
31 | |
32 | #ifdef HAS_ROCTRACER |
33 | using namespace libkineto; |
34 | #endif |
35 | |