зеркало из https://github.com/Azure/c-pal.git
Switch to logging v2 (#249)
* logging_v2 * logging_v2 * logging_v2 * logging_v2 * logging_v2 * Latest deps * Latest deps * Minor updates * Update with logging_v2 config APIs * Add logerrno to logger.h * Add one more v1 to v2 translation * Fix some issues * Use latest logging * Fix IWYU * Fix IWYU * making call count a global variable to avoid helgrind bug * Suppress printf issues in sm helgrind test * Add suppression for printf with Helgrind * Add suppression for printf with Helgrind * Address CR comment --------- Co-authored-by: Jelani Brandon <jebrando@microsoft.com>
This commit is contained in:
Родитель
6d0a809ed9
Коммит
073b5545e5
|
@ -83,9 +83,9 @@ if ((NOT TARGET macro_utils_c) AND (EXISTS ${CMAKE_CURRENT_LIST_DIR}/deps/macro-
|
|||
include_directories(${MACRO_UTILS_INC_FOLDER})
|
||||
endif()
|
||||
|
||||
if ((NOT TARGET c_logging) AND (EXISTS ${CMAKE_CURRENT_LIST_DIR}/deps/c-logging/CMakeLists.txt))
|
||||
if ((NOT TARGET c_logging_v2) AND (EXISTS ${CMAKE_CURRENT_LIST_DIR}/deps/c-logging/CMakeLists.txt))
|
||||
add_subdirectory(deps/c-logging)
|
||||
include_directories(deps/c-logging/inc)
|
||||
include_directories(deps/c-logging/v2/inc)
|
||||
endif()
|
||||
|
||||
if ((NOT TARGET ctest) AND (EXISTS ${CMAKE_CURRENT_LIST_DIR}/deps/ctest/CMakeLists.txt))
|
||||
|
|
|
@ -4,6 +4,15 @@
|
|||
fun:thread_worker_func
|
||||
...
|
||||
}
|
||||
{
|
||||
<vfprintf suppression>
|
||||
Helgrind:Race
|
||||
...
|
||||
fun:__vfprintf_internal
|
||||
...
|
||||
fun:log_sink_console_log
|
||||
...
|
||||
}
|
||||
{
|
||||
<incorrect interlocked flagging>
|
||||
Helgrind:Race
|
||||
|
|
|
@ -10,4 +10,4 @@ set(reals_pal_ll_h_files
|
|||
|
||||
add_library(pal_ll_interfaces_reals INTERFACE)
|
||||
target_include_directories(pal_ll_interfaces_reals INTERFACE ${CMAKE_CURRENT_LIST_DIR})
|
||||
target_link_libraries(pal_ll_interfaces_reals INTERFACE c_logging)
|
||||
target_link_libraries(pal_ll_interfaces_reals INTERFACE c_logging_v2)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
// IWYU pragma: no_include <wchar.h>
|
||||
#include "testrunnerswitcher.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/gballoc_hl.h"
|
||||
#include "c_pal/gballoc_hl_redirect.h" // IWYU pragma: keep
|
||||
|
|
|
@ -18,7 +18,7 @@ include_directories(../interfaces/inc)
|
|||
|
||||
add_library(pal_ll_linux ${pal_ll_linux_h_files} ${pal_ll_linux_c_files} ${pal_ll_linux_md_files})
|
||||
set_target_properties(pal_ll_linux PROPERTIES LINKER_LANGUAGE C)
|
||||
target_link_libraries(pal_ll_linux pal_interfaces rt pthread)
|
||||
target_link_libraries(pal_ll_linux pal_interfaces rt pthread c_logging_v2)
|
||||
target_include_directories(pal_ll_linux PUBLIC ${CMAKE_CURRENT_LIST_DIR}/inc)
|
||||
|
||||
# Set CMAKE_INSTALL_* if not defined
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "sys/syscall.h"
|
||||
#include "linux/futex.h"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include <pthread.h>
|
||||
#include <time.h>
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/threadapi.h"
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ add_library(pal_ll_win32 ${pal_ll_win32_h_files} ${pal_ll_win32_c_files} ${pal_l
|
|||
|
||||
set_target_properties(pal_ll_win32 PROPERTIES LINKER_LANGUAGE C)
|
||||
|
||||
target_link_libraries(pal_ll_win32 pal_ll_interfaces synchronization rpcrt4 c_logging)
|
||||
target_link_libraries(pal_ll_win32 pal_ll_interfaces synchronization rpcrt4 c_logging_v2)
|
||||
|
||||
target_include_directories(pal_ll_win32 PUBLIC ${CMAKE_CURRENT_LIST_DIR}/inc ${CMAKE_CURRENT_LIST_DIR}/src)
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "windows.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/interlocked.h"
|
||||
#include "c_pal/sync.h"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/threadapi.h"
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/ps_util.h"
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ will interact with deallocated memory / resources resulting in an undefined beha
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
// Include the platform-specific file that defines atomic functionality
|
||||
#include "c_pal/gballoc_hl.h"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "macro_utils/macro_utils.h"
|
||||
#include "umock_c/umock_c_prod.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/interlocked.h"
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/interlocked.h"
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/interlocked.h"
|
||||
#include "c_pal/sync.h"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "umock_c/umock_c_prod.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/interlocked.h"
|
||||
#include "c_pal/sync.h"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h" // for MU_COUNT_ARG_0, MU_DISPATCH_EMP...
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/call_once.h"
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/s_list.h"
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
#include "c_pal/gballoc_hl.h" // IWYU pragma: keep
|
||||
#include "c_pal/gballoc_hl_redirect.h"
|
||||
#include "c_pal/interlocked.h"
|
||||
|
|
|
@ -2,9 +2,13 @@
|
|||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_pal/refcount.h"
|
||||
#include "c_pal/gballoc_hl.h" // IWYU pragma: keep
|
||||
#include "c_pal/gballoc_hl_redirect.h" // IWYU pragma: keep
|
||||
|
||||
#include "some_refcount_impl.h"
|
||||
|
||||
typedef struct pos_TAG
|
||||
|
|
|
@ -11,6 +11,9 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h" // IWYU pragma: keep
|
||||
|
||||
#include "c_logging/log_level.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/timer.h"
|
||||
#include "c_pal/gballoc_hl.h"
|
||||
#include "c_pal/threadapi.h"
|
||||
|
@ -18,7 +21,6 @@
|
|||
#include "c_pal/sysinfo.h" // IWYU pragma: keep
|
||||
#include "c_pal/sync.h" // IWYU pragma: keep
|
||||
#include "c_pal/interlocked_hl.h"
|
||||
#include "c_logging/xlogging.h"
|
||||
|
||||
#include "c_pal/sm.h"
|
||||
|
||||
|
@ -843,8 +845,8 @@ At least 1 sm_open_begin and at least 1 sm_exec_begin are waited to happen*/
|
|||
TEST_FUNCTION(sm_chaos)
|
||||
{
|
||||
LogInfo("disabling logging for the duration of sm_chaos. Logging takes additional locks that \"might\" help the test pass");
|
||||
LOGGER_LOG toBeRestored = xlogging_get_log_function();
|
||||
xlogging_set_log_function(NULL);
|
||||
LOGGER_CONFIG old_config = logger_get_config();
|
||||
logger_set_config((LOGGER_CONFIG) { .log_sinks = NULL, .log_sink_count = 0 });
|
||||
|
||||
OPEN_CLOSE_THREADS* data = malloc(sizeof(OPEN_CLOSE_THREADS));
|
||||
ASSERT_IS_NOT_NULL(data);
|
||||
|
@ -907,7 +909,7 @@ TEST_FUNCTION(sm_chaos)
|
|||
((n_begin_open_grants_local==0) || (n_begin_grants_local==0))
|
||||
)
|
||||
{
|
||||
toBeRestored(AZ_LOG_INFO, __FILE__, FUNC_NAME, __LINE__, 0, "Slept %" PRIu32 " ms, no sign of n_begin_open_grants=%" PRId32 ", n_begin_grants=%" PRId32 "\n", counterSleep * 1000, n_begin_open_grants_local, n_begin_grants_local);
|
||||
LOGGER_LOG_WITH_CONFIG(old_config, LOG_LEVEL_INFO, NULL, "Slept %" PRIu32 " ms, no sign of n_begin_open_grants=%" PRId32 ", n_begin_grants=%" PRId32 "\n", counterSleep * 1000, n_begin_open_grants_local, n_begin_grants_local);
|
||||
counterSleep++;
|
||||
ThreadAPI_Sleep(1000);
|
||||
}
|
||||
|
@ -930,7 +932,7 @@ TEST_FUNCTION(sm_chaos)
|
|||
|
||||
/*just in case anything needs to close*/
|
||||
|
||||
toBeRestored(AZ_LOG_INFO, __FILE__, FUNC_NAME, __LINE__, 0, "nthreads=%" PRIu32
|
||||
LOGGER_LOG_WITH_CONFIG(old_config, LOG_LEVEL_INFO, NULL, "nthreads=%" PRIu32
|
||||
", n_begin_open_grants=%" PRIu32 ", n_begin_open_refuses=%" PRIu32
|
||||
", n_begin_close_grants=%" PRIu32 ", n_begin_close_refuses=%" PRIu32
|
||||
", n_begin_barrier_grants=%" PRIu32 ", n_begin_barrier_refuses=%" PRIu32
|
||||
|
@ -946,15 +948,14 @@ TEST_FUNCTION(sm_chaos)
|
|||
interlocked_add(&data->n_begin_barrier_refuses, 0),
|
||||
interlocked_add(&data->n_begin_grants, 0),
|
||||
interlocked_add(&data->n_begin_refuses, 0),
|
||||
interlocked_add(&data->n_faults, 0)
|
||||
);
|
||||
interlocked_add(&data->n_faults, 0));
|
||||
|
||||
ASSERT_IS_TRUE(interlocked_add(&data->n_begin_open_grants, 0) >= 1);
|
||||
}
|
||||
sm_destroy(data->sm);
|
||||
free(data);
|
||||
|
||||
xlogging_set_log_function(toBeRestored);
|
||||
logger_set_config(old_config);
|
||||
}
|
||||
|
||||
/*Same as the chaos test but faults occasionally happen
|
||||
|
@ -962,8 +963,8 @@ Test waits for a fault to be called*/
|
|||
TEST_FUNCTION(sm_chaos_with_faults)
|
||||
{
|
||||
LogInfo("disabling logging for the duration of sm_chaos. Logging takes additional locks that \"might\" help the test pass");
|
||||
LOGGER_LOG toBeRestored = xlogging_get_log_function();
|
||||
xlogging_set_log_function(NULL);
|
||||
LOGGER_CONFIG old_config = logger_get_config();
|
||||
logger_set_config((LOGGER_CONFIG) { .log_sinks = NULL, .log_sink_count = 0 });
|
||||
|
||||
OPEN_CLOSE_THREADS* data = malloc(sizeof(OPEN_CLOSE_THREADS));
|
||||
ASSERT_IS_NOT_NULL(data);
|
||||
|
@ -1025,7 +1026,7 @@ TEST_FUNCTION(sm_chaos_with_faults)
|
|||
((n_faults_local == 0))
|
||||
)
|
||||
{
|
||||
toBeRestored(AZ_LOG_INFO, __FILE__, FUNC_NAME, __LINE__, 0, "Slept %" PRIu32 " ms, no sign of n_faults=%" PRId32 "\n", counterSleep * 1000, n_faults_local);
|
||||
LOGGER_LOG_WITH_CONFIG(old_config, LOG_LEVEL_INFO, NULL, "Slept %" PRIu32 " ms, no sign of n_faults=%" PRId32 "\n", counterSleep * 1000, n_faults_local);
|
||||
counterSleep++;
|
||||
ThreadAPI_Sleep(1000);
|
||||
}
|
||||
|
@ -1050,7 +1051,7 @@ TEST_FUNCTION(sm_chaos_with_faults)
|
|||
|
||||
/*just in case anything needs to close*/
|
||||
|
||||
toBeRestored(AZ_LOG_INFO, __FILE__, FUNC_NAME, __LINE__, 0, "nthreads=%" PRIu32
|
||||
LOGGER_LOG_WITH_CONFIG(old_config, LOG_LEVEL_INFO, NULL, "nthreads=%" PRIu32
|
||||
", n_begin_open_grants=%" PRIu32 ", n_begin_open_refuses=%" PRIu32
|
||||
", n_begin_close_grants=%" PRIu32 ", n_begin_close_refuses=%" PRIu32
|
||||
", n_begin_barrier_grants=%" PRIu32 ", n_begin_barrier_refuses=%" PRIu32
|
||||
|
@ -1074,15 +1075,15 @@ TEST_FUNCTION(sm_chaos_with_faults)
|
|||
sm_destroy(data->sm);
|
||||
free(data);
|
||||
|
||||
xlogging_set_log_function(toBeRestored);
|
||||
logger_set_config(old_config);
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST_FUNCTION(sm_does_not_block)
|
||||
{
|
||||
LogInfo("disabling logging for the duration of sm_does_not_block. Logging takes additional locks that \"might help\" the test pass");
|
||||
LOGGER_LOG toBeRestored = xlogging_get_log_function();
|
||||
xlogging_set_log_function(NULL);
|
||||
LOGGER_CONFIG old_config = logger_get_config();
|
||||
logger_set_config((LOGGER_CONFIG) { .log_sinks = NULL, .log_sink_count = 0 });
|
||||
|
||||
///arrange
|
||||
THREADS_COMMON* data = malloc(sizeof(THREADS_COMMON));
|
||||
|
@ -1116,7 +1117,7 @@ TEST_FUNCTION(sm_does_not_block)
|
|||
ASSERT_IS_TRUE(sm_open_begin(data->sm) == SM_EXEC_GRANTED);
|
||||
sm_open_end(data->sm, true);
|
||||
|
||||
toBeRestored(AZ_LOG_INFO, __FILE__, FUNC_NAME, __LINE__, 0, "Info: nthreads=%" PRIu32 " n_barrier_threads=%" PRIu32 " n_non_barrier_threads=%" PRIu32 "\n", nthreads, n_barrier_threads, n_non_barrier_threads);
|
||||
LOGGER_LOG_WITH_CONFIG(old_config, LOG_LEVEL_INFO, NULL, "Info: nthreads=%" PRIu32 " n_barrier_threads=%" PRIu32 " n_non_barrier_threads=%" PRIu32 "\n", nthreads, n_barrier_threads, n_non_barrier_threads);
|
||||
|
||||
/*create them barrier threads*/
|
||||
for (uint32_t iBarrier = 0; iBarrier < n_barrier_threads; iBarrier++)
|
||||
|
@ -1151,7 +1152,7 @@ TEST_FUNCTION(sm_does_not_block)
|
|||
/*verify the all numbers written by barriers are greater than all previous numbers*/
|
||||
verify(data);
|
||||
|
||||
toBeRestored(AZ_LOG_INFO, __FILE__, FUNC_NAME, __LINE__, 0, "Info: took %f ms, non_barrier_grants=%" PRId32 ", non_barrier_refusals=%" PRId64 " barrier_grants=%" PRId32 ", barrier_refusals=%" PRId64 "\n", timer_global_get_elapsed_ms() - data->startTimems,
|
||||
LOGGER_LOG_WITH_CONFIG(old_config, LOG_LEVEL_INFO, NULL, "Info: took %f ms, non_barrier_grants=%" PRId32 ", non_barrier_refusals=%" PRId64 " barrier_grants=%" PRId32 ", barrier_refusals=%" PRId64 "\n", timer_global_get_elapsed_ms() - data->startTimems,
|
||||
interlocked_add(&non_barrier_grants, 0),
|
||||
interlocked_add_64(&non_barrier_refusals, 0),
|
||||
interlocked_add(&barrier_grants, 0),
|
||||
|
@ -1168,7 +1169,7 @@ TEST_FUNCTION(sm_does_not_block)
|
|||
sm_destroy(data->sm);
|
||||
free(data);
|
||||
|
||||
xlogging_set_log_function(toBeRestored);
|
||||
logger_set_config(old_config);
|
||||
}
|
||||
|
||||
/*below tests aim to see that calling any API produces GRANT/REFUSED from any state*/
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <string.h> // for strlen, memcpy
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "c_logging/xlogging.h" // for LogError
|
||||
#include "c_logging/logger.h" // for LogError
|
||||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <limits.h>
|
||||
#include <string.h> // for strlen, memcpy
|
||||
|
||||
#include "c_logging/xlogging.h" // for LogError
|
||||
#include "c_logging/logger.h" // for LogError
|
||||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "c_pal/gballoc_hl.h" // IWYU pragma: keep
|
||||
#include "c_pal/gballoc_hl_redirect.h" // IWYU pragma: keep
|
||||
|
||||
#include "c_logging/xlogging.h" // for LogError
|
||||
#include "c_logging/logger.h" // for LogError
|
||||
|
||||
#include "c_pal/thandle.h"
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c8a5f2314d83af238b8359c5b70c61f5e94f0aa1
|
||||
Subproject commit b1b3114d9e3cb2e7699bbfc4d1956019f45fe50d
|
|
@ -1 +1 @@
|
|||
Subproject commit 71986d97278b0f86ebd16d94882b4fcb4867cbe1
|
||||
Subproject commit ca5faa35c32208c748cdde92ed06deae70494675
|
|
@ -1 +1 @@
|
|||
Subproject commit b86983596d1be8d842b12687ddda147b86c908fd
|
||||
Subproject commit cbc3398b77a3959295063e3d30a94cc1595435fd
|
|
@ -1 +1 @@
|
|||
Subproject commit c736888008fed2e50ecf4f1d1451ca4d1d37226a
|
||||
Subproject commit f8616ff97291003c5e428b59dfcb046c2a62f676
|
|
@ -1 +1 @@
|
|||
Subproject commit 5ac9e36ed6ed8e5d33f95f733c3a7fbeb9211a7c
|
||||
Subproject commit 4e50d6714d471b72b2285e25a3df6c92db944593
|
|
@ -1 +1 @@
|
|||
Subproject commit d19d70719316b990fee15fa3bf198027250bcae0
|
||||
Subproject commit e11f1c408abc9c7345f1e9390486d60fec16c719
|
|
@ -26,4 +26,4 @@ endif()
|
|||
|
||||
add_library(pal_interfaces_reals INTERFACE)
|
||||
target_include_directories(pal_interfaces_reals INTERFACE ${CMAKE_CURRENT_LIST_DIR})
|
||||
target_link_libraries(pal_interfaces_reals INTERFACE c_logging)
|
||||
target_link_libraries(pal_interfaces_reals INTERFACE c_logging_v2)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <stddef.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
#include "testrunnerswitcher.h"
|
||||
|
||||
#include "c_pal/timer.h"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "macro_utils/macro_utils.h" // IWYU pragma: keep
|
||||
|
||||
#include "testrunnerswitcher.h"
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/uuid.h"
|
||||
|
||||
|
|
|
@ -11,7 +11,9 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/log_context.h"
|
||||
#include "c_logging/log_context_property_type_ascii_char_ptr.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/completion_port_linux.h"
|
||||
#include "c_pal/execution_engine.h"
|
||||
|
|
|
@ -14,7 +14,9 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/log_context.h"
|
||||
#include "c_logging/log_context_property_type_ascii_char_ptr.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/containing_record.h"
|
||||
#include "c_pal/interlocked.h"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h" // IWYU pragma: keep
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/execution_engine_linux.h"
|
||||
#include "c_pal/refcount.h"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <string.h> // for memset
|
||||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/gballoc_ll.h"
|
||||
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
#include <stdint.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/gballoc_ll.h"
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "umock_c/umock_c_prod.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/pipe.h"
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <stddef.h> // for NULL
|
||||
#include "macro_utils/macro_utils.h" // for MU_FAILURE
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/completion_port_linux.h"
|
||||
#include "c_pal/platform.h"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/gballoc_hl.h" // IWYU pragma: keep
|
||||
#include "c_pal/gballoc_hl_redirect.h" // IWYU pragma: keep
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "macro_utils/macro_utils.h" // IWYU pragma: keep
|
||||
#include "umock_c/umock_c_prod.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/gballoc_hl.h" // IWYU pragma: keep
|
||||
#include "c_pal/gballoc_hl_redirect.h" // IWYU pragma: keep
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
#include <inttypes.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/logger.h"
|
||||
#include "c_pal/sysinfo.h"
|
||||
|
||||
uint32_t sysinfo_get_processor_count(void)
|
||||
|
|
|
@ -17,7 +17,9 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/log_context.h"
|
||||
#include "c_logging/log_context_property_type_ascii_char_ptr.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/gballoc_hl.h" // IWYU pragma: keep
|
||||
#include "c_pal/gballoc_hl_redirect.h"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
#include "c_pal/gballoc_ll.h" // IWYU pragma: keep
|
||||
#include "c_pal/gballoc_ll_redirect.h" // IWYU pragma: keep
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/uuid.h"
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <time.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "macro_utils/macro_utils.h" // IWYU pragma: keep
|
||||
|
||||
|
@ -25,6 +25,8 @@
|
|||
#include "c_pal/thandle.h" // IWYU pragma: keep
|
||||
#include "c_pal/thandle_ll.h"
|
||||
|
||||
static volatile_atomic int32_t g_call_count;
|
||||
|
||||
typedef struct WAIT_WORK_CONTEXT_TAG
|
||||
{
|
||||
volatile_atomic int32_t call_count;
|
||||
|
@ -49,6 +51,7 @@ TEST_SUITE_CLEANUP(suite_cleanup)
|
|||
|
||||
TEST_FUNCTION_INITIALIZE(method_init)
|
||||
{
|
||||
(void)interlocked_exchange(&g_call_count, 0);
|
||||
}
|
||||
|
||||
TEST_FUNCTION_CLEANUP(method_cleanup)
|
||||
|
@ -85,9 +88,8 @@ static void threadpool_task_wait_random(void* parameter)
|
|||
|
||||
static void work_function(void* context)
|
||||
{
|
||||
volatile_atomic int32_t* call_count = (volatile_atomic int32_t*)context;
|
||||
(void)interlocked_increment(call_count);
|
||||
wake_by_address_single(call_count);
|
||||
(void)interlocked_increment(&g_call_count);
|
||||
wake_by_address_single(&g_call_count);
|
||||
}
|
||||
|
||||
static void wait_work_function(void* context)
|
||||
|
@ -258,7 +260,6 @@ TEST_FUNCTION(one_start_timer_works_runs_once)
|
|||
{
|
||||
// assert
|
||||
// create an execution engine
|
||||
volatile_atomic int32_t call_count;
|
||||
EXECUTION_ENGINE_PARAMETERS_LINUX params;
|
||||
params.min_thread_count = 1;
|
||||
params.max_thread_count = 16;
|
||||
|
@ -277,19 +278,17 @@ TEST_FUNCTION(one_start_timer_works_runs_once)
|
|||
bool need_to_retry = true;
|
||||
do
|
||||
{
|
||||
(void)interlocked_exchange(&call_count, 0);
|
||||
|
||||
LogInfo("Starting timer");
|
||||
|
||||
// act (start a timer to start delayed and then execute once)
|
||||
TIMER_INSTANCE_HANDLE timer;
|
||||
ASSERT_ARE_EQUAL(int, 0, threadpool_timer_start(threadpool, 2000, 0, work_function, (void*)&call_count, &timer));
|
||||
ASSERT_ARE_EQUAL(int, 0, threadpool_timer_start(threadpool, 2000, 0, work_function, NULL, &timer));
|
||||
|
||||
// assert
|
||||
|
||||
// Timer starts after 2 seconds, wait a bit and it should not yet have run
|
||||
ThreadAPI_Sleep(500);
|
||||
if (interlocked_add(&call_count, 0) != 0)
|
||||
if (interlocked_add(&g_call_count, 0) != 0)
|
||||
{
|
||||
LogWarning("Timer ran after sleeping 500ms, we just got unlucky, try test again");
|
||||
}
|
||||
|
@ -298,12 +297,12 @@ TEST_FUNCTION(one_start_timer_works_runs_once)
|
|||
LogInfo("Waiting for timer to execute after short delay of no execution");
|
||||
|
||||
// Should eventually run once (wait up to 2.5 seconds, but it should run in 1.5 seconds)
|
||||
wait_for_equal(&call_count, 1, 5000);
|
||||
wait_for_equal(&g_call_count, 1, 5000);
|
||||
LogInfo("Timer completed, make sure it doesn't run again");
|
||||
|
||||
// And should not run again
|
||||
ThreadAPI_Sleep(5000);
|
||||
ASSERT_ARE_EQUAL(uint32_t, 1, interlocked_add(&call_count, 0));
|
||||
ASSERT_ARE_EQUAL(uint32_t, 1, interlocked_add(&g_call_count, 0));
|
||||
LogInfo("Done waiting for timer");
|
||||
|
||||
need_to_retry = false;
|
||||
|
@ -321,7 +320,6 @@ TEST_FUNCTION(restart_timer_works_runs_once)
|
|||
{
|
||||
// assert
|
||||
// create an execution engine
|
||||
volatile_atomic int32_t call_count;
|
||||
EXECUTION_ENGINE_HANDLE execution_engine = execution_engine_create(NULL);
|
||||
ASSERT_IS_NOT_NULL(execution_engine);
|
||||
|
||||
|
@ -336,13 +334,11 @@ TEST_FUNCTION(restart_timer_works_runs_once)
|
|||
bool need_to_retry = true;
|
||||
do
|
||||
{
|
||||
(void)interlocked_exchange(&call_count, 0);
|
||||
|
||||
LogInfo("Starting timer");
|
||||
|
||||
// start a timer to start delayed after 4 seconds (which would fail test)
|
||||
TIMER_INSTANCE_HANDLE timer;
|
||||
ASSERT_ARE_EQUAL(int, 0, threadpool_timer_start(threadpool, 4000, 0, work_function, (void*)&call_count, &timer));
|
||||
ASSERT_ARE_EQUAL(int, 0, threadpool_timer_start(threadpool, 4000, 0, work_function, (void*)&g_call_count, &timer));
|
||||
|
||||
// act (restart timer to start delayed instead after 2 seconds)
|
||||
ASSERT_ARE_EQUAL(int, 0, threadpool_timer_restart(timer, 2000, 0));
|
||||
|
@ -351,7 +347,7 @@ TEST_FUNCTION(restart_timer_works_runs_once)
|
|||
|
||||
// Timer starts after 2 seconds, wait a bit and it should not yet have run
|
||||
ThreadAPI_Sleep(500);
|
||||
if (interlocked_add(&call_count, 0) != 0)
|
||||
if (interlocked_add(&g_call_count, 0) != 0)
|
||||
{
|
||||
LogWarning("Timer ran after sleeping 500ms, we just got unlucky, try test again");
|
||||
}
|
||||
|
@ -360,12 +356,12 @@ TEST_FUNCTION(restart_timer_works_runs_once)
|
|||
LogInfo("Waiting for timer to execute after short delay of no execution");
|
||||
|
||||
// Should eventually run once (wait up to 2.5 seconds, but it should run in 1.5 seconds)
|
||||
wait_for_equal(&call_count, 1, 2000);
|
||||
wait_for_equal(&g_call_count, 1, 2000);
|
||||
LogInfo("Timer completed, make sure it doesn't run again");
|
||||
|
||||
// And should not run again
|
||||
ThreadAPI_Sleep(5000);
|
||||
ASSERT_ARE_EQUAL(uint32_t, 1, interlocked_add(&call_count, 0));
|
||||
ASSERT_ARE_EQUAL(uint32_t, 1, interlocked_add(&g_call_count, 0));
|
||||
LogInfo("Done waiting for timer");
|
||||
|
||||
need_to_retry = false;
|
||||
|
@ -383,7 +379,6 @@ TEST_FUNCTION(one_start_timer_works_runs_periodically)
|
|||
{
|
||||
// assert
|
||||
// create an execution engine
|
||||
volatile_atomic int32_t call_count;
|
||||
EXECUTION_ENGINE_HANDLE execution_engine = execution_engine_create(NULL);
|
||||
ASSERT_IS_NOT_NULL(execution_engine);
|
||||
|
||||
|
@ -391,17 +386,15 @@ TEST_FUNCTION(one_start_timer_works_runs_periodically)
|
|||
THANDLE(THREADPOOL) threadpool = threadpool_create(execution_engine);
|
||||
ASSERT_IS_NOT_NULL(threadpool);
|
||||
|
||||
(void)interlocked_exchange(&call_count, 0);
|
||||
|
||||
// act (start a timer to start delayed and then execute every 500ms)
|
||||
LogInfo("Starting timer");
|
||||
TIMER_INSTANCE_HANDLE timer;
|
||||
ASSERT_ARE_EQUAL(int, 0, threadpool_timer_start(threadpool, 100, 500, work_function, (void*)&call_count, &timer));
|
||||
ASSERT_ARE_EQUAL(int, 0, threadpool_timer_start(threadpool, 100, 500, work_function, (void*)&g_call_count, &timer));
|
||||
|
||||
// assert
|
||||
|
||||
// Timer should run 4 times in about 2.1 seconds
|
||||
wait_for_equal(&call_count, 4, 3000);
|
||||
wait_for_equal(&g_call_count, 4, 3000);
|
||||
LogInfo("Timer completed 4 times");
|
||||
|
||||
// cleanup
|
||||
|
@ -414,7 +407,6 @@ TEST_FUNCTION(timer_cancel_restart_works_runs_periodically)
|
|||
{
|
||||
// assert
|
||||
// create an execution engine
|
||||
volatile_atomic int32_t call_count;
|
||||
EXECUTION_ENGINE_HANDLE execution_engine = execution_engine_create(NULL);
|
||||
ASSERT_IS_NOT_NULL(execution_engine);
|
||||
|
||||
|
@ -422,27 +414,25 @@ TEST_FUNCTION(timer_cancel_restart_works_runs_periodically)
|
|||
THANDLE(THREADPOOL) threadpool = threadpool_create(execution_engine);
|
||||
ASSERT_IS_NOT_NULL(threadpool);
|
||||
|
||||
(void)interlocked_exchange(&call_count, 0);
|
||||
|
||||
// start a timer to start delayed and then execute every 500ms
|
||||
LogInfo("Starting timer");
|
||||
TIMER_INSTANCE_HANDLE timer;
|
||||
ASSERT_ARE_EQUAL(int, 0, threadpool_timer_start(threadpool, 100, 500, work_function, (void*)&call_count, &timer));
|
||||
ASSERT_ARE_EQUAL(int, 0, threadpool_timer_start(threadpool, 100, 500, work_function, (void*)&g_call_count, &timer));
|
||||
|
||||
// Timer should run 4 times in about 2.1 seconds
|
||||
wait_for_equal(&call_count, 4, 3000);
|
||||
wait_for_equal(&g_call_count, 4, 3000);
|
||||
LogInfo("Timer completed 4 times");
|
||||
|
||||
// act
|
||||
LogInfo("Cancel then restart timer");
|
||||
threadpool_timer_cancel(timer);
|
||||
(void)interlocked_exchange(&call_count, 0);
|
||||
(void)interlocked_exchange(&g_call_count, 0);
|
||||
ASSERT_ARE_EQUAL(int, 0, threadpool_timer_restart(timer, 100, 1000));
|
||||
|
||||
// assert
|
||||
|
||||
// Timer should run 2 more times in about 2.1 seconds
|
||||
wait_for_equal(&call_count, 2, 3000);
|
||||
wait_for_equal(&g_call_count, 2, 3000);
|
||||
LogInfo("Timer completed 2 more times");
|
||||
|
||||
// cleanup
|
||||
|
@ -456,7 +446,6 @@ TEST_FUNCTION(stop_timer_waits_for_ongoing_execution)
|
|||
// assert
|
||||
// create an execution engine
|
||||
WAIT_WORK_CONTEXT wait_work_context;
|
||||
volatile_atomic int32_t call_count;
|
||||
EXECUTION_ENGINE_HANDLE execution_engine = execution_engine_create(NULL);
|
||||
ASSERT_IS_NOT_NULL(execution_engine);
|
||||
|
||||
|
@ -494,7 +483,6 @@ TEST_FUNCTION(cancel_timer_waits_for_ongoing_execution)
|
|||
// assert
|
||||
// create an execution engine
|
||||
WAIT_WORK_CONTEXT wait_work_context;
|
||||
volatile_atomic int32_t call_count;
|
||||
EXECUTION_ENGINE_HANDLE execution_engine = execution_engine_create(NULL);
|
||||
ASSERT_IS_NOT_NULL(execution_engine);
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ include_directories(../c_pal_ll/interfaces/inc)
|
|||
|
||||
add_library(pal_win32 ${pal_win32_h_files} ${pal_win32_c_files} ${pal_win32_md_files} ${pal_common_md_files})
|
||||
|
||||
target_link_libraries(pal_win32 pal_interfaces ws2_32 synchronization rpcrt4 c_logging)
|
||||
target_link_libraries(pal_win32 pal_interfaces ws2_32 synchronization rpcrt4 c_logging_v2)
|
||||
if(${GBALLOC_LL_TYPE} STREQUAL "MIMALLOC")
|
||||
target_link_libraries(pal_win32 mimalloc-obj)
|
||||
endif()
|
||||
|
|
|
@ -165,4 +165,4 @@ static void jemalloc_print_stats_callback(void* context, const char* text)
|
|||
|
||||
**SRS_GBALLOC_LL_JEMALLOC_01_009: [** If `text` is NULL, `jemalloc_print_stats_callback` shall return. **]**
|
||||
|
||||
**SRS_GBALLOC_LL_JEMALLOC_01_010: [** Otherwise, `jemalloc_print_stats_callback` shall print (log) `text`, breaking it does in chunks of `LOG_SIZE_REGULAR / 2`. **]**
|
||||
**SRS_GBALLOC_LL_JEMALLOC_01_010: [** Otherwise, `jemalloc_print_stats_callback` shall print (log) `text`, breaking it does in chunks of `LOG_MAX_MESSAGE_LENGTH / 2`. **]**
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/gballoc_hl.h"
|
||||
#include "c_pal/gballoc_hl_redirect.h"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "windows.h"
|
||||
#include "macro_utils/macro_utils.h"
|
||||
#include "c_pal/refcount.h"
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
#include "c_pal/execution_engine.h"
|
||||
#include "c_pal/execution_engine_win32.h"
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "windows.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
#include "c_pal/execution_engine_win32.h"
|
||||
#include "c_pal/gballoc_hl.h"
|
||||
#include "c_pal/gballoc_hl_redirect.h"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/timer.h"
|
||||
#include "c_pal/gballoc_ll.h"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <stddef.h>
|
||||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/lazy_init.h"
|
||||
#include "c_pal/gballoc_ll.h"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
#include "c_pal/gballoc_ll.h"
|
||||
|
||||
#include "jemalloc/jemalloc.h"
|
||||
|
@ -192,15 +192,15 @@ static void jemalloc_print_stats_callback(void* context, const char* text)
|
|||
}
|
||||
else
|
||||
{
|
||||
/* Codes_SRS_GBALLOC_LL_JEMALLOC_01_010: [ Otherwise, jemalloc_print_stats_callback shall print (log) text, breaking it does in chunks of LOG_SIZE_REGULAR / 2. ]*/
|
||||
/* Codes_SRS_GBALLOC_LL_JEMALLOC_01_010: [ Otherwise, jemalloc_print_stats_callback shall print (log) text, breaking it does in chunks of LOG_MAX_MESSAGE_LENGTH / 2. ]*/
|
||||
size_t text_length = strlen(text);
|
||||
size_t pos = 0;
|
||||
while (pos < text_length)
|
||||
{
|
||||
size_t chars_to_print = text_length - pos;
|
||||
if (chars_to_print > LOG_SIZE_REGULAR / 2)
|
||||
if (chars_to_print > LOG_MAX_MESSAGE_LENGTH / 2)
|
||||
{
|
||||
chars_to_print = LOG_SIZE_REGULAR / 2;
|
||||
chars_to_print = LOG_MAX_MESSAGE_LENGTH / 2;
|
||||
}
|
||||
|
||||
LogInfo("%.*s", (int)chars_to_print, text + pos);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "mimalloc.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/gballoc_ll.h"
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/gballoc_ll.h"
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "windows.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/lazy_init.h"
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// Tell IWYU to keep macro_utils.h because we have MU_FAILURE (even though we say that can come from umock_c_prod.h)
|
||||
#include "macro_utils/macro_utils.h" // IWYU pragma: keep
|
||||
#include "umock_c/umock_c_prod.h"
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
#include "c_pal/pipe.h"
|
||||
|
||||
IMPLEMENT_MOCKABLE_FUNCTION(, FILE*, pipe_popen, const char*, command)
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
#include "c_pal/platform.h"
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "winsock2.h"
|
||||
#include "minwindef.h"
|
||||
#include "winnt.h"
|
||||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_pal/platform.h"
|
||||
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
int platform_init(void)
|
||||
{
|
||||
int result;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/srw_lock_ll.h"
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "windows.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/gballoc_hl.h"
|
||||
#include "c_pal/gballoc_hl_redirect.h"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/gballoc_hl.h"
|
||||
#include "c_pal/gballoc_hl_redirect.h"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <inttypes.h>
|
||||
#include "windows.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/sysinfo.h"
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "windows.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/execution_engine.h"
|
||||
#include "c_pal/execution_engine_win32.h"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "windows.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
#include "c_pal/gballoc_ll.h"
|
||||
#include "c_pal/gballoc_ll_redirect.h"
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/uuid.h"
|
||||
|
||||
|
|
|
@ -554,7 +554,7 @@ TEST_FUNCTION(gballoc_ll_print_stats_does_not_call_the_print_function)
|
|||
}
|
||||
|
||||
/* Tests_SRS_GBALLOC_LL_JEMALLOC_01_008: [ gballoc_ll_print_stats shall call je_malloc_stats_print and pass to it jemalloc_print_stats_callback as print callback. ]*/
|
||||
/* Tests_SRS_GBALLOC_LL_JEMALLOC_01_010: [ Otherwise, jemalloc_print_stats_callback shall print (log) text, breaking it does in chunks of LOG_SIZE_REGULAR / 2. ]*/
|
||||
/* Tests_SRS_GBALLOC_LL_JEMALLOC_01_010: [ Otherwise, jemalloc_print_stats_callback shall print (log) text, breaking it does in chunks of LOG_MAX_MESSAGE_LENGTH / 2. ]*/
|
||||
TEST_FUNCTION(gballoc_ll_print_stats_calls_the_print_function_and_prints_1_small_text_line)
|
||||
{
|
||||
///arrange
|
||||
|
@ -570,7 +570,7 @@ TEST_FUNCTION(gballoc_ll_print_stats_calls_the_print_function_and_prints_1_small
|
|||
}
|
||||
|
||||
/* Tests_SRS_GBALLOC_LL_JEMALLOC_01_008: [ gballoc_ll_print_stats shall call je_malloc_stats_print and pass to it jemalloc_print_stats_callback as print callback. ]*/
|
||||
/* Tests_SRS_GBALLOC_LL_JEMALLOC_01_010: [ Otherwise, jemalloc_print_stats_callback shall print (log) text, breaking it does in chunks of LOG_SIZE_REGULAR / 2. ]*/
|
||||
/* Tests_SRS_GBALLOC_LL_JEMALLOC_01_010: [ Otherwise, jemalloc_print_stats_callback shall print (log) text, breaking it does in chunks of LOG_MAX_MESSAGE_LENGTH / 2. ]*/
|
||||
TEST_FUNCTION(gballoc_ll_print_stats_calls_the_print_function_and_prints_multiple_small_text_lines)
|
||||
{
|
||||
///arrange
|
||||
|
@ -588,7 +588,7 @@ TEST_FUNCTION(gballoc_ll_print_stats_calls_the_print_function_and_prints_multipl
|
|||
}
|
||||
|
||||
/* Tests_SRS_GBALLOC_LL_JEMALLOC_01_008: [ gballoc_ll_print_stats shall call je_malloc_stats_print and pass to it jemalloc_print_stats_callback as print callback. ]*/
|
||||
/* Tests_SRS_GBALLOC_LL_JEMALLOC_01_010: [ Otherwise, jemalloc_print_stats_callback shall print (log) text, breaking it does in chunks of LOG_SIZE_REGULAR / 2. ]*/
|
||||
/* Tests_SRS_GBALLOC_LL_JEMALLOC_01_010: [ Otherwise, jemalloc_print_stats_callback shall print (log) text, breaking it does in chunks of LOG_MAX_MESSAGE_LENGTH / 2. ]*/
|
||||
TEST_FUNCTION(gballoc_ll_print_stats_calls_the_print_function_and_prints_one_huge_line)
|
||||
{
|
||||
///arrange
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "macro_utils/macro_utils.h"
|
||||
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "c_pal/timer.h"
|
||||
#include "c_pal/threadpool.h"
|
||||
|
@ -130,7 +130,7 @@ TEST_SUITE_INITIALIZE(suite_init)
|
|||
|
||||
// Turn off logging so it doesn't put unneccesary
|
||||
// sleeps in the code.
|
||||
xlogging_set_log_function(NULL);
|
||||
logger_set_config((LOGGER_CONFIG) { .log_sinks = NULL, .log_sink_count = 0 });
|
||||
}
|
||||
|
||||
TEST_SUITE_CLEANUP(suite_cleanup)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "ws2tcpip.h"
|
||||
#include "windows.h"
|
||||
#include "macro_utils/macro_utils.h"
|
||||
#include "c_logging/xlogging.h"
|
||||
#include "c_logging/logger.h"
|
||||
|
||||
#include "real_gballoc_ll.h"
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче