!234 【openGauss】Add pldebugger feature

Merge pull request !234 from 宋清怡/master
This commit is contained in:
opengauss-bot 2020-09-18 21:01:02 +08:00 committed by Gitee
commit 9e9b6b0321
9 changed files with 2710 additions and 2 deletions

25
configure vendored
View File

@ -745,6 +745,7 @@ enable_multiple_nodes
enable_memory_check
enable_mysql_fdw
enable_oracle_fdw
enable_pldebugger
enable_thread_check
enable_shared
default_gs_version
@ -823,6 +824,7 @@ enable_multiple_nodes
enable_memory_check
enable_mysql_fdw
enable_oracle_fdw
enable_pldebugger
enable_thread_check
enable_spinlocks
enable_debug
@ -2893,6 +2895,29 @@ else
fi
# Check whether --enable-pldebugger was given.
if test "${enable_pldebugger+set}" = set; then
enableval=$enable_pldebugger;
case $enableval in
yes)
:
;;
no)
:
;;
*)
{ { $as_echo "$as_me:$LINENO: error: no argument expected for --enable-pldebugger option" >&5
$as_echo "$as_me: error: no argument expected for --enable-pldebugger option" >&2;}
{ (exit 1); exit 1; }; }
;;
esac
else
enable_pldebugger=no
fi
# Check whether --enable-thread-check was given.
if test "${enable_thread_check+set}" = set; then
enableval=$enable_thread_check;

View File

@ -0,0 +1,49 @@
#
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
#
# openGauss is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# ---------------------------------------------------------------------------------------
#
# Makefile
# Makefile for the pldebugger
#
# IDENTIFICATION
# contrib/pldebugger/Makefile
#
# ---------------------------------------------------------------------------------------
all:pldebuger_target
install:install-data
top_builddir = ../../
PLDEBUGGER_DIR=$(top_builddir)/third_party/dependency/pldebugger
#source code
PLDEBUGGER_PACKAGE=pldebugger_3_0
PLDEBUGGER_PATCH=huawei_pldebugger
PLDEBUGGER_MEGRED_SOURCES_DIR=$(PLDEBUGGER_DIR)
.PHONY: pldebugger_target
pldebuger_target:
@$(call create_pldebugger_sources)
@make -C $(PLDEBUGGER_MEGRED_SOURCES_DIR)/$(PLDEBUGGER_PACKAGE)
.PHONY: install-data
install-data: pldebugger_target
@make -C $(PLDEBUGGER_MEGRED_SOURCES_DIR)/$(PLDEBUGGER_PACKAGE) install
uninstall distclean clean:
@rm -rf $(PLDEBUGGER_MEGRED_SOURCES_DIR)/$(PLDEBUGGER_PACKAGE)
define create_pldebugger_sources
cd $(PLDEBUGGER_DIR); \
sh patch.sh; \
cd - ;
endef

View File

@ -173,6 +173,7 @@ enable_jemalloc_debug = @enable_jemalloc_debug@
enable_multiple_nodes = @enable_multiple_nodes@
enable_mysql_fdw = @enable_mysql_fdw@
enable_oracle_fdw = @enable_oracle_fdw@
enable_pldebugger = @enable_pldebugger@
enable_memory_check = @enable_memory_check@
enable_memory_check_core = @enable_memory_check_core@
enable_thread_check = @enable_thread_check@

View File

@ -36,6 +36,10 @@ ifeq ($(enable_oracle_fdw), yes)
SUBDIRS += $(top_builddir)/contrib/oracle_fdw
endif
ifeq ($(enable_pldebugger), yes)
SUBDIRS += $(top_builddir)/contrib/pldebugger-master
endif
ifeq ($(enable_multiple_nodes), yes)
SUBDIRS += ../distribute/kernel ../distribute/kernel/extension/roach_api ../distribute/kernel/extension/dimsearch/main \
../distribute/kernel/extension/tsdb

View File

@ -155,7 +155,8 @@ static const char *BuiltinTrancheNames[] = {
"LWTRANCHE_ACCOUNT_TABLE",
"GeneralExtendedLock",
/* LWTRANCHE_GTT_CTL */
"GlobalTempTableControl"
"GlobalTempTableControl",
"PLdebugger"
};
static void RegisterLWLockTranches(void);

View File

@ -2030,12 +2030,16 @@ enum knl_ext_fdw_type {
MYSQL_TYPE_FDW,
ORACLE_TYPE_FDW,
POSTGRES_TYPE_FDW,
PLDEBUG_TYPE,
/* Add new external FDW type before MAX_TYPE_FDW */
MAX_TYPE_FDW
};
typedef struct knl_u_ext_fdw_context {
void* connList; /* Connection info to other DB */
union {
void* connList; /* Connection info to other DB */
void* pldbg_ctx; /* Pldebugger info */
};
pg_on_exit_callback fdwExitFunc; /* Exit callback, will be called when session exit */
} knl_u_ext_fdw_context;

View File

@ -143,6 +143,7 @@ enum BuiltinTrancheIds {
LWTRANCHE_ACCOUNT_TABLE,
LWTRANCHE_EXTEND, // For general 3rd plugin
LWTRANCHE_GTT_CTL, // For GTT
LWTRANCHE_PLDEBUG, // For Pldebugger
/*
* Each trancheId above should have a corresponding item in BuiltinTrancheNames;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
rm -rf pldebugger_3_0
tar xfzv pldebugger_3_0.tar.gz &> /dev/null
rename ".c" ".cpp" pldebugger_3_0/*.c
file_name="huawei_pldebugger.patch"
if [ ! -f "$file_name" ]; then
exit 0;
fi
patch -p0 -d pldebugger_3_0 < $file_name