2019-12-22 17:20:33 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-12-23 18:56:57 +00:00
|
|
|
#ifdef OS_LINUX /// Because of 'sigqueue' functions and RT signals.
|
|
|
|
|
2019-12-22 20:17:16 +00:00
|
|
|
#include <mutex>
|
2021-10-02 07:13:14 +00:00
|
|
|
#include <base/shared_ptr_helper.h>
|
2019-12-22 17:20:33 +00:00
|
|
|
#include <Storages/System/IStorageSystemOneBlock.h>
|
|
|
|
|
2021-02-20 06:11:42 +00:00
|
|
|
namespace Poco
|
|
|
|
{
|
|
|
|
class Logger;
|
|
|
|
}
|
2019-12-22 17:20:33 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class Context;
|
|
|
|
|
|
|
|
|
|
|
|
/// Allows to introspect stack trace of all server threads.
|
|
|
|
/// It acts like an embedded debugger.
|
2019-12-23 19:23:54 +00:00
|
|
|
/// More than one instance of this table cannot be used.
|
2021-06-15 19:55:21 +00:00
|
|
|
class StorageSystemStackTrace final : public shared_ptr_helper<StorageSystemStackTrace>, public IStorageSystemOneBlock<StorageSystemStackTrace>
|
2019-12-22 17:20:33 +00:00
|
|
|
{
|
2021-06-15 19:55:21 +00:00
|
|
|
friend struct shared_ptr_helper<StorageSystemStackTrace>;
|
2019-12-22 17:20:33 +00:00
|
|
|
public:
|
|
|
|
String getName() const override { return "SystemStackTrace"; }
|
|
|
|
static NamesAndTypesList getNamesAndTypes();
|
|
|
|
|
2022-03-13 12:23:51 +00:00
|
|
|
explicit StorageSystemStackTrace(const StorageID & table_id_);
|
2019-12-22 20:17:16 +00:00
|
|
|
|
2019-12-22 17:20:33 +00:00
|
|
|
protected:
|
|
|
|
using IStorageSystemOneBlock::IStorageSystemOneBlock;
|
2021-04-10 23:33:54 +00:00
|
|
|
void fillData(MutableColumns & res_columns, ContextPtr context, const SelectQueryInfo & query_info) const override;
|
2019-12-22 20:17:16 +00:00
|
|
|
|
|
|
|
mutable std::mutex mutex;
|
2021-02-20 06:11:42 +00:00
|
|
|
|
|
|
|
Poco::Logger * log;
|
2019-12-22 17:20:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-12-23 18:56:57 +00:00
|
|
|
#endif
|