From ca71ed9dc69ed110f3b739dc933705fefd50240a Mon Sep 17 00:00:00 2001 From: Wu Tao Date: Wed, 15 Jan 2020 17:47:41 +0800 Subject: [PATCH] refactor: remove useless files (version.h, coredump.win.cpp, ReleaseNote) (#379) --- Release Note.txt | 33 ------- include/dsn/version.h | 2 - src/core/core/core_main.cpp | 3 +- src/core/core/coredump.win.cpp | 167 --------------------------------- 4 files changed, 1 insertion(+), 204 deletions(-) delete mode 100644 Release Note.txt delete mode 100644 include/dsn/version.h delete mode 100644 src/core/core/coredump.win.cpp diff --git a/Release Note.txt b/Release Note.txt deleted file mode 100644 index b99b3ea972..0000000000 --- a/Release Note.txt +++ /dev/null @@ -1,33 +0,0 @@ - -Robust Distributed System Nucleus (rDSN) is an open framework for quickly building robust and high performance distributed systems. Besides Programmability and High-Performance that many other frameworks focus on, rDSN provides a holistic solution to also systematically and (semi-)transparently address topics important for robustness that occur throughout the whole lifetime of a distributed system's development and operation, such as test, debug, deployment, how to scale-up/out, and how to achieve high-availability. The system has been used and validated in production inside Microsoft. The current release is in C++ and can run on Ubuntu, OS X, and Windows. - -Release notes @ 4/15/2015, Version 0.9 - -- Languages and platforms - . C++ - . Ubuntu14.04/Windows 8.1 - -- What's New - - . src/core: the kernel of rDSN, which defines the Service API and the Tool API, and translates the former to the latter. - . Service API: RPC, thread/tasking, synchronizing (lock, semaphore, etc.), asynchronous file IO, and environment (time and random), and the service_app abstraction. - . Tool API: component abstractions for network, task queue, task worker, lock, rw_lock, semaphore, aio_provider, env_provier, message_parser, perf_counter, logging_provider, and the toollet/tool_app abstractions. - - . src/dev: syntactic sugar for application development, including the serverlet abstraction and the typed interface for RPC/task calls. - - . src/tools/common: default component provider instances for locks, logger, aio_provider, network (adapted from boost asio), task queue, etc. It also implements several simple tools such as tracer, profiler, and fault injector. - - . src/tools/simulator: simulation tool implementation which virtualizes time and random, and enables cooperative scheduling of the tasks. Together with the fault injector tool in rDSN.tools.common, it supports random tests with faults, and deterministic replay to reproduce the bugs when exposed. - - . src/dist/failure_detector: a perfect failure detector implementation based on rDSN's programming model, which also serves as a common distributed system component. - - . src/apps/echo: a simple echo service as the application example. - - . src/apps/replication: a replication framework based on rDSN's programming model, which also servers as a common distributed system component. - - . codegen: code generator tool to leverage Apache Thrift/Google Protocol Buffer to generate the application code based on a given IDL file. - - . codegen/libs: code generation templates. - - - diff --git a/include/dsn/version.h b/include/dsn/version.h deleted file mode 100644 index ab5659def0..0000000000 --- a/include/dsn/version.h +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#define DSN_CORE_VERSION "1.0.0" diff --git a/src/core/core/core_main.cpp b/src/core/core/core_main.cpp index 2c0173fdd7..8ba6065b57 100644 --- a/src/core/core/core_main.cpp +++ b/src/core/core/core_main.cpp @@ -63,12 +63,11 @@ void dsn_core_init() } #if defined(__linux__) -#include #include #define STR_I(var) #var #define STR(var) STR_I(var) static char const rcsid[] = - "$Version: rDSN " DSN_CORE_VERSION " (" DSN_GIT_COMMIT ")" + "$Version: rDSN (" DSN_GIT_COMMIT ")" #if defined(DSN_BUILD_TYPE) " " STR(DSN_BUILD_TYPE) #endif diff --git a/src/core/core/coredump.win.cpp b/src/core/core/coredump.win.cpp deleted file mode 100644 index 6cc8f2dd11..0000000000 --- a/src/core/core/coredump.win.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2015 Microsoft Corporation - * - * -=- Robust Distributed System Nucleus (rDSN) -=- - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ - -#include -#include "coredump.h" - -#ifdef _WIN32 - -#include -#include -#include -#include -#include -#pragma comment(lib, "PsApi.lib") - -namespace dsn { -namespace utils { - -static std::string s_dump_dir; -static char s_app_name[256] = "unknown"; - -static LONG WINAPI TopLevelFilter(struct _EXCEPTION_POINTERS *pExceptionInfo); - -void coredump::init(const char *dump_dir) -{ - s_dump_dir = dump_dir; - - ::GetModuleBaseNameA(::GetCurrentProcess(), ::GetModuleHandleA(NULL), s_app_name, 256); - - ::SetUnhandledExceptionFilter(TopLevelFilter); -} - -void coredump::write() { TopLevelFilter(0); } - -typedef BOOL(WINAPI *MINIDUMPWRITEDUMP)(HANDLE hProcess, - DWORD dwPid, - HANDLE fh, - MINIDUMP_TYPE DumpType, - CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, - CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, - CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam); - -static LONG WINAPI TopLevelFilter(struct _EXCEPTION_POINTERS *pExceptionInfo) -{ - LONG retval = EXCEPTION_CONTINUE_SEARCH; - HWND hParent = NULL; // find a better value for your app - - // firstly see if dbghelp.dll is around and has the function we need - // look next to the EXE first, as the one in System32 might be old - // (e.g. Windows 2000) - HMODULE hDll = NULL; - - if (hDll == NULL) { - // load any version we can - hDll = ::LoadLibraryA("DBGHELP.DLL"); - } - - LPCSTR szResult = "core dump success"; - char szDumpPath[512]; - char szScratch[512]; - - dfatal("fatal exception, core dump started ..."); - - if (hDll) { - MINIDUMPWRITEDUMP pDump = (MINIDUMPWRITEDUMP)::GetProcAddress(hDll, "MiniDumpWriteDump"); - if (pDump) { - sprintf(szDumpPath, - "%s\\%s_%d_%" PRId64 ".dmp", - s_dump_dir.c_str(), - s_app_name, - ::GetCurrentProcessId(), - (int64_t)time(NULL)); - - // create the file - HANDLE fh = ::CreateFileA(szDumpPath, - GENERIC_WRITE, - FILE_SHARE_WRITE, - NULL, - CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, - NULL); - - if (fh != INVALID_HANDLE_VALUE) { - _MINIDUMP_EXCEPTION_INFORMATION ExInfo; - - ExInfo.ThreadId = ::GetCurrentThreadId(); - ExInfo.ExceptionPointers = pExceptionInfo; - ExInfo.ClientPointers = NULL; - - // write the dump - BOOL bOK = pDump(GetCurrentProcess(), - GetCurrentProcessId(), - fh, - MiniDumpWithFullMemory, - &ExInfo, - NULL, - NULL); - if (bOK) { - sprintf(szScratch, "saved dump file to '%s'", szDumpPath); - szResult = szScratch; - retval = EXCEPTION_EXECUTE_HANDLER; - } else { - sprintf(szScratch, - "failed to save dump file to '%s' (error %d)", - szDumpPath, - GetLastError()); - szResult = szScratch; - } - ::CloseHandle(fh); - } else { - sprintf(szScratch, - "failed to create dump file '%s' (error %d)", - szDumpPath, - GetLastError()); - szResult = szScratch; - } - } else { - szResult = "DBGHELP.DLL too old"; - } - } else { - szResult = "DBGHELP.DLL not found"; - } - - if (szResult) { - derror("%s", szResult); - printf(szResult); - } - - ::dsn::tools::sys_exit.execute(SYS_EXIT_EXCEPTION); - return retval; -} -} -} - -#endif // _WIN32