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>
|
2022-07-13 08:44:53 +00:00
|
|
|
#include <Storages/IStorage.h>
|
2019-12-22 17:20:33 +00:00
|
|
|
|
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.
|
2022-07-13 08:44:53 +00:00
|
|
|
class StorageSystemStackTrace final : public IStorage
|
2019-12-22 17:20:33 +00:00
|
|
|
{
|
|
|
|
public:
|
2022-04-19 20:47:29 +00:00
|
|
|
explicit StorageSystemStackTrace(const StorageID & table_id_);
|
|
|
|
|
2019-12-22 17:20:33 +00:00
|
|
|
String getName() const override { return "SystemStackTrace"; }
|
|
|
|
|
2022-07-13 08:44:53 +00:00
|
|
|
Pipe read(
|
|
|
|
const Names & column_names,
|
|
|
|
const StorageSnapshotPtr & storage_snapshot,
|
|
|
|
SelectQueryInfo & query_info,
|
|
|
|
ContextPtr context,
|
|
|
|
QueryProcessingStage::Enum processed_stage,
|
|
|
|
size_t max_block_size,
|
2022-10-07 10:46:45 +00:00
|
|
|
size_t num_streams) override;
|
2019-12-22 20:17:16 +00:00
|
|
|
|
2022-07-13 08:44:53 +00:00
|
|
|
bool isSystemStorage() const override { return true; }
|
2021-02-20 06:11:42 +00:00
|
|
|
|
2022-07-13 08:44:53 +00:00
|
|
|
protected:
|
|
|
|
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
|