2016-02-09 15:12:00 -08:00
|
|
|
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
|
2017-07-15 16:03:42 -07: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 14:59:46 -07:00
|
|
|
//
|
2013-10-04 22:32:05 -07:00
|
|
|
#pragma once
|
2020-02-20 12:07:53 -08:00
|
|
|
|
|
|
|
#include "rocksdb/rocksdb_namespace.h"
|
|
|
|
|
|
|
|
namespace ROCKSDB_NAMESPACE {
|
2014-04-23 09:11:35 -04:00
|
|
|
namespace port {
|
2013-04-11 10:54:35 -07:00
|
|
|
|
|
|
|
// Install a signal handler to print callstack on the following signals:
|
|
|
|
// SIGILL SIGSEGV SIGBUS SIGABRT
|
|
|
|
// Currently supports linux only. No-op otherwise.
|
|
|
|
void InstallStackTraceHandler();
|
|
|
|
|
2013-12-06 17:11:09 -08:00
|
|
|
// Prints stack, skips skip_first_frames frames
|
|
|
|
void PrintStack(int first_frames_to_skip = 0);
|
|
|
|
|
2020-04-10 17:18:56 -07: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 09:11:35 -04:00
|
|
|
} // namespace port
|
2020-02-20 12:07:53 -08:00
|
|
|
} // namespace ROCKSDB_NAMESPACE
|