1 | #pragma once |
---|---|
2 | |
3 | #ifdef OS_LINUX /// Because of 'sigqueue' functions and RT signals. |
4 | |
5 | #include <mutex> |
6 | #include <ext/shared_ptr_helper.h> |
7 | #include <Storages/System/IStorageSystemOneBlock.h> |
8 | |
9 | |
10 | namespace DB |
11 | { |
12 | |
13 | class Context; |
14 | |
15 | |
16 | /// Allows to introspect stack trace of all server threads. |
17 | /// It acts like an embedded debugger. |
18 | /// More than one instance of this table cannot be used. |
19 | class StorageSystemStackTrace : public ext::shared_ptr_helper<StorageSystemStackTrace>, public IStorageSystemOneBlock<StorageSystemStackTrace> |
20 | { |
21 | friend struct ext::shared_ptr_helper<StorageSystemStackTrace>; |
22 | public: |
23 | String getName() const override { return "SystemStackTrace"; } |
24 | static NamesAndTypesList getNamesAndTypes(); |
25 | |
26 | StorageSystemStackTrace(const String & name_); |
27 | |
28 | protected: |
29 | using IStorageSystemOneBlock::IStorageSystemOneBlock; |
30 | void fillData(MutableColumns & res_columns, const Context & context, const SelectQueryInfo & query_info) const override; |
31 | |
32 | mutable std::mutex mutex; |
33 | }; |
34 | |
35 | } |
36 | |
37 | #endif |
38 |