Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common: include new logging functions in linkers files #6066

Merged
merged 3 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/libpmem/libpmem.link.in
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/libpmemobj/libpmemobj.link.in
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/test/scope/out2.log.match
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 11 additions & 5 deletions utils/call_stacks_analysis/make_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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']

Expand Down Expand Up @@ -422,13 +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 = 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)
Expand Down
Loading