2016-02-09 23:12:00 +00:00
|
|
|
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
|
2017-07-15 23:03:42 +00:00
|
|
|
// This source code is licensed under both the GPLv2 (found in the
|
|
|
|
// COPYING file in the root directory) and Apache 2.0 License
|
|
|
|
// (found in the LICENSE.Apache file in the root directory).
|
2013-10-16 21:59:46 +00:00
|
|
|
//
|
2013-10-05 05:32:05 +00:00
|
|
|
#pragma once
|
2020-02-20 20:07:53 +00:00
|
|
|
|
|
|
|
#include "rocksdb/rocksdb_namespace.h"
|
|
|
|
|
|
|
|
namespace ROCKSDB_NAMESPACE {
|
2014-04-23 13:11:35 +00:00
|
|
|
namespace port {
|
2013-04-11 17:54:35 +00:00
|
|
|
|
|
|
|
// Install a signal handler to print callstack on the following signals:
|
|
|
|
// SIGILL SIGSEGV SIGBUS SIGABRT
|
2022-10-18 07:35:35 +00:00
|
|
|
// And also (Linux ony for now) overrides security settings to allow outside
|
|
|
|
// processes to attach to this one as a debugger. ONLY USE FOR NON-SECURITY
|
|
|
|
// CRITICAL PROCESSES such as unit tests or benchmarking tools.
|
|
|
|
// Currently supports only some POSIX implementations. No-op otherwise.
|
2013-04-11 17:54:35 +00:00
|
|
|
void InstallStackTraceHandler();
|
|
|
|
|
2013-12-07 01:11:09 +00:00
|
|
|
// Prints stack, skips skip_first_frames frames
|
|
|
|
void PrintStack(int first_frames_to_skip = 0);
|
|
|
|
|
2020-04-11 00:18:56 +00:00
|
|
|
// Prints the given callstack
|
|
|
|
void PrintAndFreeStack(void* callstack, int num_frames);
|
|
|
|
|
|
|
|
// Save the current callstack
|
|
|
|
void* SaveStack(int* num_frame, int first_frames_to_skip = 0);
|
|
|
|
|
2014-04-23 13:11:35 +00:00
|
|
|
} // namespace port
|
2020-02-20 20:07:53 +00:00
|
|
|
} // namespace ROCKSDB_NAMESPACE
|