From 204e1ab0cfc986e9f43a72feb9cd5dc95d65e0cc Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Thu, 21 Mar 2024 08:29:13 +0100 Subject: [PATCH 1/3] common: include new logging functions in linkers files Signed-off-by: Tomasz Gromadzki --- src/libpmem/libpmem.link.in | 5 ++++- src/libpmemobj/libpmemobj.link.in | 2 +- src/test/scope/out2.log.match | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/libpmem/libpmem.link.in b/src/libpmem/libpmem.link.in index 16673da952a..7dea4b1a6b8 100644 --- a/src/libpmem/libpmem.link.in +++ b/src/libpmem/libpmem.link.in @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation +# Copyright 2014-2024, Intel Corporation # # # src/libpmem.link -- linker link file for libpmem @@ -20,6 +20,9 @@ LIBPMEM_1.0 { pmem_has_hw_drain; pmem_check_version; pmem_errormsg; + pmem_log_get_threshold; + pmem_log_set_function; + pmem_log_set_threshold; pmem_memmove_persist; pmem_memcpy_persist; pmem_memset_persist; diff --git a/src/libpmemobj/libpmemobj.link.in b/src/libpmemobj/libpmemobj.link.in index 0bb0aea2e02..da9db4b9d57 100644 --- a/src/libpmemobj/libpmemobj.link.in +++ b/src/libpmemobj/libpmemobj.link.in @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2020, Intel Corporation +# Copyright 2014-2024, Intel Corporation # # # src/libpmemobj.link -- linker link file for libpmemobj diff --git a/src/test/scope/out2.log.match b/src/test/scope/out2.log.match index 50225a08d30..20e7dda9247 100644 --- a/src/test/scope/out2.log.match +++ b/src/test/scope/out2.log.match @@ -10,6 +10,9 @@ pmem_has_auto_flush$(nW) pmem_has_hw_drain$(nW) $(OPT)pmem_inject_fault_at$(nW) pmem_is_pmem$(nW) +pmem_log_get_threshold$(nW) +pmem_log_set_function$(nW) +pmem_log_set_threshold$(nW) pmem_map_file$(nW) pmem_memcpy$(nW) pmem_memcpy_nodrain$(nW) From 7e879feea468d26854348c3dcb8d8176f1ccc3da Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Thu, 21 Mar 2024 08:29:13 +0100 Subject: [PATCH 2/3] common: include new logging functions in call_stacks_analysis Signed-off-by: Tomasz Gromadzki --- utils/call_stacks_analysis/make_extra.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/utils/call_stacks_analysis/make_extra.py b/utils/call_stacks_analysis/make_extra.py index d6352201716..bdc1e9cbe91 100755 --- a/utils/call_stacks_analysis/make_extra.py +++ b/utils/call_stacks_analysis/make_extra.py @@ -22,12 +22,10 @@ def dict_extend(dict_, key, values): def inlines(calls: Calls) -> Calls: # common calls['core_init'] = ['util_init', 'core_log_init', 'out_init'] - calls['core_fini'] = ['out_fini', 'core_log_fini'] + calls['core_fini'] = ['out_fini', 'core_log_fini', 'last_error_msg_fini'] calls['common_init'] = ['core_init', 'util_mmap_init'] calls['common_fini'] = ['util_mmap_fini', 'core_fini'] - calls['Last_errormsg_key_alloc'] = ['_Last_errormsg_key_alloc'] - calls['_Last_errormsg_key_alloc'] = ['os_once', 'os_tls_key_create'] - calls['core_log_va'] = ['core_log_default_function'] + calls['core_log_init'] = ['core_log_default_init', 'core_log_set_function'] # libpmem calls['flush_empty'] = ['flush_empty_nolog'] @@ -41,6 +39,10 @@ def inlines(calls: Calls) -> Calls: return calls +def core_function_pointers(calls: Calls) -> Calls: + calls['core_log_va'] = ['core_log_default_function'] + return calls + def pmem_function_pointers(calls: Calls) -> Calls: calls['pmem_drain'] = ['fence_empty', 'memory_barrier'] @@ -424,6 +426,7 @@ def get_callees(calls): def main(): extra_calls = inlines({}) + extra_calls = core_function_pointers(extra_calls) extra_calls = pmem_function_pointers(extra_calls) extra_calls = pmemobj_function_pointers(extra_calls) with open("extra_calls.json", "w") as outfile: From dd0b61b2b82a76ceb63d0a6588382058ccbe5775 Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Wed, 27 Mar 2024 13:50:50 +0100 Subject: [PATCH 3/3] common: temporar fix for improper inline functions parsing Signed-off-by: Tomasz Gromadzki --- utils/call_stacks_analysis/make_extra.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/call_stacks_analysis/make_extra.py b/utils/call_stacks_analysis/make_extra.py index bdc1e9cbe91..c1bc42be3d7 100755 --- a/utils/call_stacks_analysis/make_extra.py +++ b/utils/call_stacks_analysis/make_extra.py @@ -424,14 +424,17 @@ def get_callees(calls): callees.extend(v) return list(set(callees)) +# XXX +# The way how inlines() function is used shall be changed according to: +# https://github.com/pmem/pmdk/issues/6070 def main(): - extra_calls = inlines({}) - extra_calls = core_function_pointers(extra_calls) + extra_calls = core_function_pointers({}) extra_calls = pmem_function_pointers(extra_calls) extra_calls = pmemobj_function_pointers(extra_calls) with open("extra_calls.json", "w") as outfile: json.dump(extra_calls, outfile, indent = 4) + extra_calls = inlines(extra_calls) # All functions accessed via function pointers have to be provided # on top of regular API calls for cflow to process their call stacks. extra_entry_points = get_callees(extra_calls)