From 9b2a884f96850eea198aef01898b788162ed82a0 Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Mon, 29 Jan 2024 11:36:27 +0100 Subject: [PATCH 1/6] common: convert LOG(2,...) into CORE_LOG_WARNING() Signed-off-by: Tomasz Gromadzki --- src/common/file.c | 40 ++++++++++++---------- src/common/mmap.c | 4 +-- src/common/os_deep_linux.c | 5 +-- src/common/set.c | 68 ++++++++++++++++++++++--------------- src/common/shutdown_state.c | 10 +++--- src/common/uuid.c | 14 ++++---- src/common/uuid_linux.c | 6 ++-- src/libpmem/pmem.c | 3 +- src/libpmemobj/heap.c | 6 ++-- src/libpmemobj/lane.c | 3 +- src/libpmemobj/list.c | 10 +++--- src/libpmemobj/memops.c | 2 +- src/libpmemobj/obj.c | 28 +++++++-------- src/libpmemobj/palloc.c | 3 +- src/libpmempool/pool.c | 4 +-- src/libpmempool/replica.c | 8 +++-- src/libpmempool/rm.c | 6 ++-- src/libpmempool/sync.c | 8 ++--- src/libpmempool/transform.c | 7 ++-- src/test/traces/traces.c | 2 +- src/tools/pmempool/common.c | 4 +-- 21 files changed, 133 insertions(+), 108 deletions(-) diff --git a/src/common/file.c b/src/common/file.c index 9d4574f470e..b79cab02f44 100644 --- a/src/common/file.c +++ b/src/common/file.c @@ -209,13 +209,13 @@ util_file_map_whole(const char *path) ssize_t size = util_fd_get_size(fd); if (size < 0) { - LOG(2, "cannot determine file length \"%s\"", path); + CORE_LOG_WARNING("cannot determine file length \"%s\"", path); goto out; } addr = util_map(fd, 0, (size_t)size, MAP_SHARED, 0, 0, NULL); if (addr == NULL) { - LOG(2, "failed to map entire file \"%s\"", path); + CORE_LOG_WARNING("failed to map entire file \"%s\"", path); goto out; } @@ -247,27 +247,29 @@ util_file_zero(const char *path, os_off_t off, size_t len) ssize_t size = util_fd_get_size(fd); if (size < 0) { - LOG(2, "cannot determine file length \"%s\"", path); + CORE_LOG_WARNING("cannot determine file length \"%s\"", path); ret = -1; goto out; } if (off > size) { - LOG(2, "offset beyond file length, %ju > %ju", off, size); + CORE_LOG_WARNING("offset beyond file length, %ju > %ju", off, + size); ret = -1; goto out; } if ((size_t)off + len > (size_t)size) { - LOG(2, "requested size of write goes beyond the file length, " - "%zu > %zu", (size_t)off + len, size); + CORE_LOG_WARNING( + "requested size of write goes beyond the file length, %zu > %zu", + (size_t)off + len, size); LOG(4, "adjusting len to %zu", size - off); len = (size_t)(size - off); } void *addr = util_map(fd, 0, (size_t)size, MAP_SHARED, 0, 0, NULL); if (addr == NULL) { - LOG(2, "failed to map entire file \"%s\"", path); + CORE_LOG_WARNING("failed to map entire file \"%s\"", path); ret = -1; goto out; } @@ -302,7 +304,7 @@ util_file_pwrite(const char *path, const void *buffer, size_t size, if (type == TYPE_NORMAL) { int fd = util_file_open(path, NULL, 0, O_RDWR); if (fd < 0) { - LOG(2, "failed to open file \"%s\"", path); + CORE_LOG_WARNING("failed to open file \"%s\"", path); return -1; } @@ -315,21 +317,22 @@ util_file_pwrite(const char *path, const void *buffer, size_t size, ssize_t file_size = util_file_get_size(path); if (file_size < 0) { - LOG(2, "cannot determine file length \"%s\"", path); + CORE_LOG_WARNING("cannot determine file length \"%s\"", path); return -1; } size_t max_size = (size_t)(file_size - offset); if (size > max_size) { - LOG(2, "requested size of write goes beyond the file length, " - "%zu > %zu", size, max_size); + CORE_LOG_WARNING( + "requested size of write goes beyond the file length, %zu > %zu", + size, max_size); LOG(4, "adjusting size to %zu", max_size); size = max_size; } void *addr = util_file_map_whole(path); if (addr == NULL) { - LOG(2, "failed to map entire file \"%s\"", path); + CORE_LOG_WARNING("failed to map entire file \"%s\"", path); return -1; } @@ -355,7 +358,7 @@ util_file_pread(const char *path, void *buffer, size_t size, if (type == TYPE_NORMAL) { int fd = util_file_open(path, NULL, 0, O_RDONLY); if (fd < 0) { - LOG(2, "failed to open file \"%s\"", path); + CORE_LOG_WARNING("failed to open file \"%s\"", path); return -1; } @@ -368,21 +371,22 @@ util_file_pread(const char *path, void *buffer, size_t size, ssize_t file_size = util_file_get_size(path); if (file_size < 0) { - LOG(2, "cannot determine file length \"%s\"", path); + CORE_LOG_WARNING("cannot determine file length \"%s\"", path); return -1; } size_t max_size = (size_t)(file_size - offset); if (size > max_size) { - LOG(2, "requested size of read goes beyond the file length, " - "%zu > %zu", size, max_size); + CORE_LOG_WARNING( + "requested size of read goes beyond the file length, %zu > %zu", + size, max_size); LOG(4, "adjusting size to %zu", max_size); size = max_size; } void *addr = util_file_map_whole(path); if (addr == NULL) { - LOG(2, "failed to map entire file \"%s\"", path); + CORE_LOG_WARNING("failed to map entire file \"%s\"", path); return -1; } @@ -540,7 +544,7 @@ util_unlink_flock(const char *path) int fd = util_file_open(path, NULL, 0, O_RDONLY); if (fd < 0) { - LOG(2, "failed to open file \"%s\"", path); + CORE_LOG_WARNING("failed to open file \"%s\"", path); return -1; } diff --git a/src/common/mmap.c b/src/common/mmap.c index aaf4b3deddb..48bb01d1233 100644 --- a/src/common/mmap.c +++ b/src/common/mmap.c @@ -51,9 +51,9 @@ util_mmap_init(void) unsigned long long val = strtoull(e, &endp, 16); if (errno || endp == e) { - LOG(2, "Invalid PMEM_MMAP_HINT"); + CORE_LOG_WARNING("Invalid PMEM_MMAP_HINT"); } else if (os_access(OS_MAPFILE, R_OK)) { - LOG(2, "No /proc, PMEM_MMAP_HINT ignored"); + CORE_LOG_WARNING("No /proc, PMEM_MMAP_HINT ignored"); } else { Mmap_hint = (void *)val; Mmap_no_random = 1; diff --git a/src/common/os_deep_linux.c b/src/common/os_deep_linux.c index d4fe2065541..4460832bc52 100644 --- a/src/common/os_deep_linux.c +++ b/src/common/os_deep_linux.c @@ -39,8 +39,9 @@ os_deep_type(const struct map_tracker *mt, void *addr, size_t len) "deep_flush not supported"); } else { errno = pmem2_err_to_errno(ret); - LOG(2, "cannot write to deep_flush" - "in region %u", mt->region_id); + CORE_LOG_WARNING( + "cannot write to deep_flush in region %u", + mt->region_id); } return -1; } diff --git a/src/common/set.c b/src/common/set.c index cb930c42105..ed5a7521912 100644 --- a/src/common/set.c +++ b/src/common/set.c @@ -340,7 +340,7 @@ util_poolset_open(struct pool_set *set) { for (unsigned r = 0; r < set->nreplicas; ++r) { if (util_replica_open(set, r, MAP_SHARED)) { - LOG(2, "replica open failed: replica %u", r); + CORE_LOG_WARNING("replica open failed: replica %u", r); errno = EINVAL; return -1; } @@ -1050,9 +1050,9 @@ util_poolset_directory_load(struct pool_replica **repp, const char *directory) ssize_t size = util_file_get_size(entry->path); if (size < 0) { - LOG(2, - "cannot read size of file (%s) in a poolset directory", - entry->path); + CORE_LOG_WARNING( + "cannot read size of file (%s) in a poolset directory", + entry->path); goto err; } @@ -1481,7 +1481,8 @@ util_part_open(struct pool_set_part *part, size_t minsize, int create_part) part->fd = util_file_create(part->path, part->filesize, minsize); if (part->fd == -1) { - LOG(2, "failed to create file: %s", part->path); + CORE_LOG_WARNING("failed to create file: %s", + part->path); return -1; } part->created = 1; @@ -1490,7 +1491,7 @@ util_part_open(struct pool_set_part *part, size_t minsize, int create_part) int flags = O_RDWR; part->fd = util_file_open(part->path, &size, minsize, flags); if (part->fd == -1) { - LOG(2, "failed to open file: %s", part->path); + CORE_LOG_WARNING("failed to open file: %s", part->path); return -1; } @@ -1968,7 +1969,8 @@ util_replica_map_local(struct pool_set *set, unsigned repidx, int flags) /* map the first part and reserve space for remaining parts */ if (util_map_part(&rep->part[0], addr, rep->resvsize, 0, flags, 0) != 0) { - LOG(2, "pool mapping failed - replica #%u part #0", + CORE_LOG_WARNING( + "pool mapping failed - replica #%u part #0", repidx); return -1; } @@ -1997,8 +1999,9 @@ util_replica_map_local(struct pool_set *set, unsigned repidx, int flags) */ if ((errno == EINVAL) && (remaining_retries > 0)) { - LOG(2, "usable space mapping failed - " - "part #%d - retrying", p); + CORE_LOG_WARNING( + "usable space mapping failed - part #%d - retrying", + p); retry_for_contiguous_addr = 1; remaining_retries--; @@ -2010,7 +2013,8 @@ util_replica_map_local(struct pool_set *set, unsigned repidx, int flags) munmap(addr, rep->resvsize - mapsize); break; } - LOG(2, "usable space mapping failed - part #%d", + CORE_LOG_WARNING( + "usable space mapping failed - part #%d", p); goto err; } @@ -2078,7 +2082,7 @@ util_replica_init_headers_local(struct pool_set *set, unsigned repidx, /* map all headers - don't care about the address */ for (unsigned p = 0; p < rep->nhdrs; p++) { if (util_map_hdr(&rep->part[p], flags, 0) != 0) { - LOG(2, "header mapping failed - part #%d", p); + CORE_LOG_WARNING("header mapping failed - part #%d", p); goto err; } } @@ -2086,7 +2090,8 @@ util_replica_init_headers_local(struct pool_set *set, unsigned repidx, /* create headers, set UUID's */ for (unsigned p = 0; p < rep->nhdrs; p++) { if (util_header_create(set, repidx, p, attr, 0) != 0) { - LOG(2, "header creation failed - part #%d", p); + CORE_LOG_WARNING("header creation failed - part #%d", + p); goto err; } } @@ -2122,7 +2127,7 @@ util_replica_create_local(struct pool_set *set, unsigned repidx, int flags, */ if (PART(REP(set, repidx), 0)->addr == NULL) { if (util_replica_map_local(set, repidx, flags) != 0) { - LOG(2, "replica #%u map failed", repidx); + CORE_LOG_WARNING("replica #%u map failed", repidx); return -1; } } @@ -2131,7 +2136,8 @@ util_replica_create_local(struct pool_set *set, unsigned repidx, int flags, return 0; if (util_replica_init_headers_local(set, repidx, flags, attr) != 0) { - LOG(2, "replica #%u headers initialization failed", repidx); + CORE_LOG_WARNING("replica #%u headers initialization failed", + repidx); return -1; } return 0; @@ -2389,7 +2395,7 @@ util_pool_create_uuids(struct pool_set **setp, const char *path, int ret = util_poolset_create_set(setp, path, poolsize, minsize, IGNORE_SDS(attr)); if (ret < 0) { - LOG(2, "cannot create pool set -- '%s'", path); + CORE_LOG_WARNING("cannot create pool set -- '%s'", path); return -1; } @@ -2476,7 +2482,8 @@ util_pool_create_uuids(struct pool_set **setp, const char *path, /* generate pool set UUID */ ret = util_uuid_generate(set->uuid); if (ret < 0) { - LOG(2, "cannot generate pool set UUID"); + CORE_LOG_WARNING( + "cannot generate pool set UUID"); goto err_poolset; } } @@ -2487,7 +2494,7 @@ util_pool_create_uuids(struct pool_set **setp, const char *path, for (unsigned i = 0; i < rep->nhdrs; i++) { ret = util_uuid_generate(rep->part[i].uuid); if (ret < 0) { - LOG(2, + CORE_LOG_WARNING( "cannot generate pool set part UUID"); goto err_poolset; } @@ -2514,7 +2521,7 @@ util_pool_create_uuids(struct pool_set **setp, const char *path, for (unsigned r = 0; r < set->nreplicas; r++) { if (util_replica_create_local(set, r, flags, attr) != 0) { - LOG(2, "replica #%u creation failed", r); + CORE_LOG_WARNING("replica #%u creation failed", r); goto err_create; } } @@ -2591,7 +2598,8 @@ util_replica_open_local(struct pool_set *set, unsigned repidx, int flags) /* map the first part and reserve space for remaining parts */ if (util_map_part(&rep->part[0], addr, rep->resvsize, 0, flags, 0) != 0) { - LOG(2, "pool mapping failed - replica #%u part #0", + CORE_LOG_WARNING( + "pool mapping failed - replica #%u part #0", repidx); return -1; } @@ -2604,7 +2612,8 @@ util_replica_open_local(struct pool_set *set, unsigned repidx, int flags) /* map all headers - don't care about the address */ for (unsigned p = 0; p < rep->nhdrs; p++) { if (util_map_hdr(&rep->part[p], flags, 0) != 0) { - LOG(2, "header mapping failed - part #%d", p); + CORE_LOG_WARNING( + "header mapping failed - part #%d", p); goto err; } } @@ -2637,8 +2646,9 @@ util_replica_open_local(struct pool_set *set, unsigned repidx, int flags) */ if ((errno == EINVAL) && (remaining_retries > 0)) { - LOG(2, "usable space mapping failed - " - "part #%d - retrying", p); + CORE_LOG_WARNING( + "usable space mapping failed - part #%d - retrying", + p); retry_for_contiguous_addr = 1; remaining_retries--; @@ -2649,7 +2659,8 @@ util_replica_open_local(struct pool_set *set, unsigned repidx, int flags) rep->resvsize); break; } - LOG(2, "usable space mapping failed - part #%d", + CORE_LOG_WARNING( + "usable space mapping failed - part #%d", p); goto err; } @@ -2779,7 +2790,8 @@ util_replica_check(struct pool_set *set, const struct pool_attr *attr) struct pool_replica *rep = set->replica[r]; for (unsigned p = 0; p < rep->nhdrs; p++) { if (util_header_check(set, r, p, attr) != 0) { - LOG(2, "header check failed - part #%d", p); + CORE_LOG_WARNING( + "header check failed - part #%d", p); return -1; } set->rdonly |= rep->part[p].rdonly; @@ -2808,7 +2820,7 @@ util_replica_check(struct pool_set *set, const struct pool_attr *attr) ASSERTne(rep->nparts, 0); if (shutdown_state_check(&sds, &HDR(rep, 0)->sds, rep)) { - LOG(2, "ADR failure detected"); + CORE_LOG_WARNING("ADR failure detected"); errno = EINVAL; return -1; } @@ -2901,7 +2913,7 @@ util_pool_open_nocheck(struct pool_set *set, unsigned flags) for (unsigned r = 0; r < set->nreplicas; r++) { if (util_replica_open(set, r, mmap_flags) != 0) { - LOG(2, "replica #%u open failed", r); + CORE_LOG_WARNING("replica #%u open failed", r); goto err_replica; } } @@ -2992,7 +3004,7 @@ util_pool_open(struct pool_set **setp, const char *path, size_t minpartsize, int ret = util_poolset_create_set(setp, path, 0, 0, flags & POOL_OPEN_IGNORE_SDS); if (ret < 0) { - LOG(2, "cannot open pool set -- '%s'", path); + CORE_LOG_WARNING("cannot open pool set -- '%s'", path); return -1; } @@ -3064,7 +3076,7 @@ util_pool_open(struct pool_set **setp, const char *path, size_t minpartsize, for (unsigned r = 0; r < set->nreplicas; r++) { if (util_replica_open(set, r, mmap_flags) != 0) { - LOG(2, "replica #%u open failed", r); + CORE_LOG_WARNING("replica #%u open failed", r); goto err_replica; } } diff --git a/src/common/shutdown_state.c b/src/common/shutdown_state.c index 919bc29c528..66d20e5dd52 100644 --- a/src/common/shutdown_state.c +++ b/src/common/shutdown_state.c @@ -77,7 +77,8 @@ shutdown_state_add_part(struct shutdown_state *sds, int fd, ERR_WO_ERRNO( "Cannot read unsafe shutdown count. For more information please check https://github.com/pmem/pmdk/issues/4207"); } - LOG(2, "cannot read unsafe shutdown count for %d", fd); + CORE_LOG_WARNING("cannot read unsafe shutdown count for %d", + fd); goto err; } @@ -202,7 +203,8 @@ shutdown_state_check(struct shutdown_state *curr_sds, if (!is_checksum_correct) { /* the program was killed during opening or closing the pool */ - LOG(2, "incorrect checksum - SDS will be reinitialized"); + CORE_LOG_WARNING( + "incorrect checksum - SDS will be reinitialized"); shutdown_state_reinit(curr_sds, pool_sds, rep); return 0; } @@ -214,14 +216,14 @@ shutdown_state_check(struct shutdown_state *curr_sds, * the program was killed when the pool was opened * but there wasn't an ADR failure */ - LOG(2, + CORE_LOG_WARNING( "the pool was not closed - SDS will be reinitialized"); shutdown_state_reinit(curr_sds, pool_sds, rep); return 0; } if (dirty == 0) { /* an ADR failure but the pool was closed */ - LOG(2, + CORE_LOG_WARNING( "an ADR failure was detected but the pool was closed - SDS will be reinitialized"); shutdown_state_reinit(curr_sds, pool_sds, rep); return 0; diff --git a/src/common/uuid.c b/src/common/uuid.c index 0b16d7f7c58..c1c084c82e3 100644 --- a/src/common/uuid.c +++ b/src/common/uuid.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2021, Intel Corporation */ +/* Copyright 2014-2024, Intel Corporation */ /* * uuid.c -- uuid utilities @@ -20,12 +20,12 @@ util_uuid_to_string(const uuid_t u, char *buf) int len; /* size that is returned from sprintf call */ if (buf == NULL) { - LOG(2, "invalid buffer for uuid string"); + CORE_LOG_WARNING("invalid buffer for uuid string"); return -1; } if (u == NULL) { - LOG(2, "invalid uuid structure"); + CORE_LOG_WARNING("invalid uuid structure"); return -1; } @@ -38,7 +38,7 @@ util_uuid_to_string(const uuid_t u, char *buf) uuid->node[5]); if (len != POOL_HDR_UUID_STR_LEN - 1) { - LOG(2, "snprintf(uuid): %d", len); + CORE_LOG_WARNING("snprintf(uuid): %d", len); return -1; } @@ -56,13 +56,13 @@ int util_uuid_from_string(const char uuid[POOL_HDR_UUID_STR_LEN], struct uuid *ud) { if (strlen(uuid) != 36) { - LOG(2, "invalid uuid string"); + CORE_LOG_WARNING("invalid uuid string"); return -1; } if (uuid[8] != '-' || uuid[13] != '-' || uuid[18] != '-' || uuid[23] != '-') { - LOG(2, "invalid uuid string"); + CORE_LOG_WARNING("invalid uuid string"); return -1; } @@ -75,7 +75,7 @@ util_uuid_from_string(const char uuid[POOL_HDR_UUID_STR_LEN], struct uuid *ud) &ud->node[5]); if (n != 11) { - LOG(2, "sscanf(uuid)"); + CORE_LOG_WARNING("sscanf(uuid)"); return -1; } diff --git a/src/common/uuid_linux.c b/src/common/uuid_linux.c index 979e0ad52ba..16ee2dae531 100644 --- a/src/common/uuid_linux.c +++ b/src/common/uuid_linux.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2015-2017, Intel Corporation */ +/* Copyright 2015-2024, Intel Corporation */ /* * uuid_linux.c -- pool set utilities with OS-specific implementation @@ -28,13 +28,13 @@ util_uuid_generate(uuid_t uuid) int fd = os_open(POOL_HDR_UUID_GEN_FILE, O_RDONLY); if (fd < 0) { /* Fatal error */ - LOG(2, "!open(uuid)"); + CORE_LOG_WARNING("!open(uuid)"); return -1; } ssize_t num = read(fd, uu, POOL_HDR_UUID_STR_LEN); if (num < POOL_HDR_UUID_STR_LEN) { /* Fatal error */ - LOG(2, "!read(uuid)"); + CORE_LOG_WARNING("!read(uuid)"); os_close(fd); return -1; } diff --git a/src/libpmem/pmem.c b/src/libpmem/pmem.c index 931ae63b550..c552a246f67 100644 --- a/src/libpmem/pmem.c +++ b/src/libpmem/pmem.c @@ -477,7 +477,8 @@ pmem_map_fileU(const char *path, size_t len, int flags, if ((fd = util_tmpfile(path, OS_DIR_SEP_STR"pmem.XXXXXX", open_flags & O_EXCL)) < 0) { - LOG(2, "failed to create temporary file at \"%s\"", + CORE_LOG_WARNING( + "failed to create temporary file at \"%s\"", path); return NULL; } diff --git a/src/libpmemobj/heap.c b/src/libpmemobj/heap.c index e71c5513735..78900137dfc 100644 --- a/src/libpmemobj/heap.c +++ b/src/libpmemobj/heap.c @@ -1189,7 +1189,7 @@ heap_split_block(struct palloc_heap *heap, struct bucket *b, NULL, NULL, 0, 0, NULL}; memblock_rebuild_state(heap, &r); if (bucket_insert_block(b, &r) != 0) - LOG(2, + CORE_LOG_WARNING( "failed to allocate memory block runtime tracking info"); } else { uint32_t new_chunk_id = m->chunk_id + units; @@ -1201,7 +1201,7 @@ heap_split_block(struct palloc_heap *heap, struct bucket *b, *m = memblock_huge_init(heap, m->chunk_id, m->zone_id, units); if (bucket_insert_block(b, &n) != 0) - LOG(2, + CORE_LOG_WARNING( "failed to allocate memory block runtime tracking info"); } @@ -1324,7 +1324,7 @@ heap_set_narenas_max(struct palloc_heap *heap, unsigned size) util_mutex_lock(&h->arenas.lock); unsigned capacity = (unsigned)VEC_CAPACITY(&h->arenas.vec); if (size < capacity) { - LOG(2, "cannot decrease max number of arenas"); + CORE_LOG_WARNING("cannot decrease max number of arenas"); goto out; } else if (size == capacity) { ret = 0; diff --git a/src/libpmemobj/lane.c b/src/libpmemobj/lane.c index 0dcdbe59ccd..00ab7f3820d 100644 --- a/src/libpmemobj/lane.c +++ b/src/libpmemobj/lane.c @@ -414,7 +414,8 @@ lane_check(PMEMobjpool *pop) layout = lane_get_layout(pop, j); if (ulog_check((struct ulog *)&layout->internal, OBJ_OFF_IS_VALID_FROM_CTX, &pop->p_ops) != 0) { - LOG(2, "lane %" PRIu64 " internal redo failed: %d", + CORE_LOG_WARNING( + "lane %" PRIu64 " internal redo failed: %d", j, err); return err; } diff --git a/src/libpmemobj/list.c b/src/libpmemobj/list.c index af2cfbbd2a0..01185130833 100644 --- a/src/libpmemobj/list.c +++ b/src/libpmemobj/list.c @@ -561,7 +561,7 @@ list_insert_new_user(PMEMobjpool *pop, int ret; if ((ret = pmemobj_mutex_lock(pop, &user_head->lock))) { errno = ret; - LOG(2, "pmemobj_mutex_lock failed"); + CORE_LOG_WARNING("pmemobj_mutex_lock failed"); return -1; } @@ -600,7 +600,7 @@ list_insert(PMEMobjpool *pop, if ((ret = pmemobj_mutex_lock(pop, &head->lock))) { errno = ret; - LOG(2, "pmemobj_mutex_lock failed"); + CORE_LOG_WARNING("pmemobj_mutex_lock failed"); ret = -1; goto err; } @@ -728,7 +728,7 @@ list_remove_free_user(PMEMobjpool *pop, size_t pe_offset, int ret; if ((ret = pmemobj_mutex_lock(pop, &user_head->lock))) { errno = ret; - LOG(2, "pmemobj_mutex_lock failed"); + CORE_LOG_WARNING("pmemobj_mutex_lock failed"); return -1; } @@ -762,7 +762,7 @@ list_remove(PMEMobjpool *pop, if ((ret = pmemobj_mutex_lock(pop, &head->lock))) { errno = ret; - LOG(2, "pmemobj_mutex_lock failed"); + CORE_LOG_WARNING("pmemobj_mutex_lock failed"); ret = -1; goto err; } @@ -839,7 +839,7 @@ list_move(PMEMobjpool *pop, */ if ((ret = list_mutexes_lock(pop, head_new, head_old))) { errno = ret; - LOG(2, "list_mutexes_lock failed"); + CORE_LOG_WARNING("list_mutexes_lock failed"); ret = -1; goto err; } diff --git a/src/libpmemobj/memops.c b/src/libpmemobj/memops.c index f9c630b4f19..7d86c41a32f 100644 --- a/src/libpmemobj/memops.c +++ b/src/libpmemobj/memops.c @@ -349,7 +349,7 @@ operation_merge_entry_add(struct operation_context *ctx, if (VECQ_ENQUEUE(&ctx->merge_entries, entry) != 0) { /* this is fine, only runtime perf will get slower */ - LOG(2, "out of memory - unable to track entries"); + CORE_LOG_WARNING("out of memory - unable to track entries"); } } diff --git a/src/libpmemobj/obj.c b/src/libpmemobj/obj.c index 6849ff47102..a1eda31b54e 100644 --- a/src/libpmemobj/obj.c +++ b/src/libpmemobj/obj.c @@ -87,7 +87,7 @@ obj_ctl_init_and_load(PMEMobjpool *pop) LOG(3, "pop %p", pop); if (pop != NULL && (pop->ctl = ctl_new()) == NULL) { - LOG(2, "!ctl_new"); + CORE_LOG_WARNING("!ctl_new"); return -1; } @@ -102,8 +102,8 @@ obj_ctl_init_and_load(PMEMobjpool *pop) if (env_config != NULL) { if (ctl_load_config_from_string(pop ? pop->ctl : NULL, pop, env_config) != 0) { - LOG(2, "unable to parse config stored in %s " - "environment variable", + CORE_LOG_WARNING( + "unable to parse config stored in %s environment variable", OBJ_CONFIG_ENV_VARIABLE); goto err; } @@ -113,10 +113,9 @@ obj_ctl_init_and_load(PMEMobjpool *pop) if (env_config_file != NULL && env_config_file[0] != '\0') { if (ctl_load_config_from_file(pop ? pop->ctl : NULL, pop, env_config_file) != 0) { - LOG(2, "unable to parse config stored in %s " - "file (from %s environment variable)", - env_config_file, - OBJ_CONFIG_FILE_ENV_VARIABLE); + CORE_LOG_WARNING( + "unable to parse config stored in %s file (from %s environment variable)", + env_config_file, OBJ_CONFIG_FILE_ENV_VARIABLE); goto err; } } @@ -1088,7 +1087,7 @@ pmemobj_createU(const char *path, const char *layout, if (util_pool_create(&set, path, poolsize, PMEMOBJ_MIN_POOL, PMEMOBJ_MIN_PART, &adj_pool_attr, &runtime_nlanes, REPLICAS_ENABLED) != 0) { - LOG(2, "cannot create pool or pool set"); + CORE_LOG_WARNING("cannot create pool or pool set"); os_mutex_unlock(&pools_mutex); return NULL; } @@ -1125,7 +1124,7 @@ pmemobj_createU(const char *path, const char *layout, /* create pool descriptor */ if (obj_descr_create(pop, layout, set->poolsize) != 0) { - LOG(2, "creation of pool descriptor failed"); + CORE_LOG_WARNING("creation of pool descriptor failed"); goto err; } @@ -1187,7 +1186,7 @@ obj_check_basic_local(PMEMobjpool *pop, size_t mapped_size) } if ((errno = lane_check(pop)) != 0) { - LOG(2, "!lane_check"); + CORE_LOG_WARNING("!lane_check"); consistent = 0; } @@ -1196,7 +1195,7 @@ obj_check_basic_local(PMEMobjpool *pop, size_t mapped_size) errno = palloc_heap_check((char *)pop + pop->heap_offset, heap_size); if (errno != 0) { - LOG(2, "!heap_check"); + CORE_LOG_WARNING("!heap_check"); consistent = 0; } @@ -1236,7 +1235,7 @@ obj_pool_open(struct pool_set **set, const char *path, unsigned flags, { if (util_pool_open(set, path, PMEMOBJ_MIN_PART, &Obj_open_attr, nlanes, NULL, flags) != 0) { - LOG(2, "cannot open pool or pool set"); + CORE_LOG_WARNING("cannot open pool or pool set"); return -1; } @@ -1373,7 +1372,8 @@ obj_open_common(const char *path, const char *layout, unsigned flags, int boot) PMEMobjpool *rep = repset->part[0].addr; /* check descriptor */ if (obj_descr_check(rep, layout, set->poolsize) != 0) { - LOG(2, "descriptor check of replica #%u failed", r); + CORE_LOG_WARNING( + "descriptor check of replica #%u failed", r); goto err_descr_check; } } @@ -2435,7 +2435,7 @@ pmemobj_root_construct(PMEMobjpool *pop, size_t size, if (size > pop->root_size && obj_alloc_root(pop, size, constructor, arg)) { pmemobj_mutex_unlock_nofail(pop, &pop->rootlock); - LOG(2, "obj_realloc_root failed"); + CORE_LOG_WARNING("obj_realloc_root failed"); PMEMOBJ_API_END(); return OID_NULL; } diff --git a/src/libpmemobj/palloc.c b/src/libpmemobj/palloc.c index bbce59dff68..7b2f7c8b3ff 100644 --- a/src/libpmemobj/palloc.c +++ b/src/libpmemobj/palloc.c @@ -304,7 +304,8 @@ palloc_restore_free_chunk_state(struct palloc_heap *heap, CORE_LOG_FATAL( "duplicate runtime chunk state, possible double free"); } else { - LOG(2, "unable to track runtime chunk state"); + CORE_LOG_WARNING( + "unable to track runtime chunk state"); } } heap_bucket_release(b); diff --git a/src/libpmempool/pool.c b/src/libpmempool/pool.c index f6d6866e487..d4b734d2619 100644 --- a/src/libpmempool/pool.c +++ b/src/libpmempool/pool.c @@ -187,7 +187,7 @@ pool_params_parse(const PMEMpoolcheck *ppc, struct pool_params *params, ret = util_poolset_create_set(&set, ppc->path, 0, 0, true); if (ret < 0) { - LOG(2, "cannot open pool set -- '%s'", + CORE_LOG_WARNING("cannot open pool set -- '%s'", ppc->path); return -1; } @@ -296,7 +296,7 @@ pool_set_file_open(const char *fname, int rdonly) int ret = util_poolset_create_set(&file->poolset, path, 0, 0, true); if (ret < 0) { - LOG(2, "cannot open pool set -- '%s'", path); + CORE_LOG_WARNING("cannot open pool set -- '%s'", path); goto err_free_fname; } unsigned flags = (rdonly ? POOL_OPEN_COW : 0) | diff --git a/src/libpmempool/replica.c b/src/libpmempool/replica.c index 6dc1c08b9b8..1cfb00473cd 100644 --- a/src/libpmempool/replica.c +++ b/src/libpmempool/replica.c @@ -1694,9 +1694,11 @@ check_uuids_between_replicas(struct pool_set *set, uuid_t *rep_n_uuidp = NULL; unsigned r_n = REPN_HEALTHidx(set_hs, r); if (get_replica_uuid(rep, r, set_hs, &rep_uuidp)) - LOG(2, "cannot get replica uuid, replica %u", r); + CORE_LOG_WARNING("cannot get replica uuid, replica %u", + r); if (get_replica_uuid(rep_n, r_n, set_hs, &rep_n_uuidp)) - LOG(2, "cannot get replica uuid, replica %u", r_n); + CORE_LOG_WARNING("cannot get replica uuid, replica %u", + r_n); /* * check if replica uuids are consistent between two adjacent @@ -1732,7 +1734,7 @@ check_uuids_between_replicas(struct pool_set *set, unsigned p_nn = replica_find_unbroken_part(r_nn, set_hs); if (p_nn == UNDEF_PART) { - LOG(2, + CORE_LOG_WARNING( "cannot compare uuids on borders of replica %u", r); continue; diff --git a/src/libpmempool/rm.c b/src/libpmempool/rm.c index b8faabcba29..cbb540249a0 100644 --- a/src/libpmempool/rm.c +++ b/src/libpmempool/rm.c @@ -20,7 +20,7 @@ #define ERR_F(f, ...) do {\ if (CHECK_FLAG((f), FORCE))\ - LOG(2, "!(ignored) " __VA_ARGS__);\ + CORE_LOG_WARNING("!(ignored) " __VA_ARGS__);\ else\ ERR_WO_ERRNO(__VA_ARGS__);\ } while (0) @@ -122,11 +122,11 @@ pmempool_rmU(const char *path, unsigned flags) } if (!is_poolset) { - LOG(2, "%s: not a poolset file", path); + CORE_LOG_WARNING("%s: not a poolset file", path); return rm_local(path, flags, 0); } - LOG(2, "%s: poolset file", path); + CORE_LOG_WARNING("%s: poolset file", path); /* fill up pool_set structure */ struct pool_set *set = NULL; diff --git a/src/libpmempool/sync.c b/src/libpmempool/sync.c index 7e61b7108a6..2f9b7672480 100644 --- a/src/libpmempool/sync.c +++ b/src/libpmempool/sync.c @@ -41,7 +41,7 @@ validate_args(struct pool_set *set) * (now replication works only for pmemobj pools) */ if (replica_check_part_sizes(set, PMEMOBJ_MIN_POOL)) { - LOG(2, "part sizes check failed"); + CORE_LOG_WARNING("part sizes check failed"); goto err; } @@ -49,7 +49,7 @@ validate_args(struct pool_set *set) * check if all directories for part files exist */ if (replica_check_part_dirs(set)) { - LOG(2, "part directories check failed"); + CORE_LOG_WARNING("part directories check failed"); goto err; } @@ -851,14 +851,14 @@ recreate_broken_parts(struct pool_set *set, /* remove parts from broken replica */ if (replica_remove_part(set, r, p, fix_bad_blocks)) { - LOG(2, "cannot remove part"); + CORE_LOG_WARNING("cannot remove part"); return -1; } /* create removed part and open it */ if (util_part_open(&broken_r->part[p], 0, 1 /* create */)) { - LOG(2, "cannot open/create parts"); + CORE_LOG_WARNING("cannot open/create parts"); return -1; } diff --git a/src/libpmempool/transform.c b/src/libpmempool/transform.c index 8b927fa35b5..3a671dc14f6 100644 --- a/src/libpmempool/transform.c +++ b/src/libpmempool/transform.c @@ -374,13 +374,13 @@ identify_transform_operation(struct poolset_compare_status *set_in_s, for (unsigned r = 0; r < set_in_s->nreplicas; ++r) { unsigned c = replica_counterpart(r, set_in_s); if (c != UNDEF_REPLICA) { - LOG(2, "replica %u has a counterpart %u", r, + CORE_LOG_WARNING("replica %u has a counterpart %u", r, set_in_s->replica[r]); has_replica_to_keep = 1; REP_HEALTH(set_out_hs, c)->pool_size = REP_HEALTH(set_in_hs, r)->pool_size; } else { - LOG(2, "replica %u has no counterpart", r); + CORE_LOG_WARNING("replica %u has no counterpart", r); is_removing_replicas = 1; } } @@ -394,7 +394,8 @@ identify_transform_operation(struct poolset_compare_status *set_in_s, /* check if there are replicas to be added */ for (unsigned r = 0; r < set_out_s->nreplicas; ++r) { if (replica_counterpart(r, set_out_s) == UNDEF_REPLICA) { - LOG(2, "Replica %u from output set has no counterpart", + CORE_LOG_WARNING( + "Replica %u from output set has no counterpart", r); if (is_removing_replicas) { ERR_WO_ERRNO( diff --git a/src/test/traces/traces.c b/src/test/traces/traces.c index f465729d640..e61046bcebf 100644 --- a/src/test/traces/traces.c +++ b/src/test/traces/traces.c @@ -26,7 +26,7 @@ main(int argc, char *argv[]) MAJOR_VERSION, MINOR_VERSION); LOG(0, "Log level NONE"); CORE_LOG_ERROR("Log level ERROR"); - LOG(2, "Log level WARNING"); + CORE_LOG_WARNING("Log level WARNING"); LOG(3, "Log level INFO"); LOG(4, "Log level DEBUG"); diff --git a/src/tools/pmempool/common.c b/src/tools/pmempool/common.c index 4fac0ca94a4..88ebc8419ca 100644 --- a/src/tools/pmempool/common.c +++ b/src/tools/pmempool/common.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2023, Intel Corporation */ +/* Copyright 2014-2024, Intel Corporation */ /* * common.c -- definitions of common functions @@ -1304,7 +1304,7 @@ util_pool_clear_badblocks(const char *path, int create) int ret = util_poolset_create_set(&setp, path, 0, 0, POOL_OPEN_IGNORE_SDS); if (ret < 0) { - LOG(2, "cannot open pool set -- '%s'", path); + CORE_LOG_WARNING("cannot open pool set -- '%s'", path); return -1; } From 2fae65a014fa316b14aa529123e252cf2cbe8f1e Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Mon, 29 Jan 2024 14:09:14 +0100 Subject: [PATCH 2/6] common: exclude warn messages in pmempool_sync tests until #5983 fixed Signed-off-by: Tomasz Gromadzki --- src/test/pmempool_sync/TEST10 | 4 ++-- src/test/pmempool_sync/TEST11 | 4 ++-- src/test/pmempool_sync/TEST23 | 4 ++-- src/test/pmempool_sync/TEST24 | 4 ++-- src/test/pmempool_sync/TEST29 | 4 ++-- src/test/pmempool_sync/TEST32 | 4 ++-- src/test/pmempool_sync/TEST33 | 4 ++-- src/test/pmempool_sync/TEST34 | 4 ++-- src/test/pmempool_sync/TEST35 | 4 ++-- src/test/pmempool_sync/TEST36 | 4 ++-- src/test/pmempool_sync/TEST37 | 4 ++-- src/test/pmempool_sync/TEST42 | 4 ++-- src/test/pmempool_sync/TEST43 | 4 ++-- src/test/pmempool_sync/TEST44 | 4 ++-- src/test/pmempool_sync/TEST45 | 4 ++-- src/test/pmempool_sync/TEST46 | 4 ++-- src/test/pmempool_sync/TEST47 | 4 ++-- src/test/pmempool_sync/TEST48 | 4 ++-- src/test/pmempool_sync/TEST49 | 4 ++-- src/test/pmempool_sync/TEST50 | 4 ++-- src/test/pmempool_sync/TEST51 | 4 ++-- src/test/pmempool_sync/TEST52 | 4 ++-- src/test/pmempool_sync/TEST53 | 4 ++-- src/test/pmempool_sync/TEST8 | 4 ++-- src/test/pmempool_sync/TEST9 | 4 ++-- 25 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/test/pmempool_sync/TEST10 b/src/test/pmempool_sync/TEST10 index 14556f9b60f..13c78b73e0e 100755 --- a/src/test/pmempool_sync/TEST10 +++ b/src/test/pmempool_sync/TEST10 @@ -51,8 +51,8 @@ expect_abnormal_exit $PMEMPOOL$EXESUFFIX sync $POOLSET2 >> $LOG_TEMP 2>&1 # Check metadata using pmempool info dump_pool_info $POOLSET1 >> $LOG_TEMP -# Exclude error messages printed out on the stderr by PMDK in debug -fgrep -v "*ERROR*" $LOG_TEMP > $LOG +# Exclude error and warn messages printed out on the stderr by PMDK in debug +fgrep -v "*ERROR*" $LOG_TEMP | fgrep -v "*WARN*" > $LOG rm $LOG_TEMP check diff --git a/src/test/pmempool_sync/TEST11 b/src/test/pmempool_sync/TEST11 index a4003f1d619..22ed47b9afd 100755 --- a/src/test/pmempool_sync/TEST11 +++ b/src/test/pmempool_sync/TEST11 @@ -61,8 +61,8 @@ expect_normal_exit $DDMAP$EXESUFFIX -o $DIR/part20 -n 10 -b 1 # Try to synchronize replicas using the third poolset expect_abnormal_exit $PMEMPOOL$EXESUFFIX sync $POOLSET3 &>> $LOG_TEMP -# Exclude error messages printed out on the stderr by PMDK in debug -fgrep -v "*ERROR*" $LOG_TEMP > $LOG +# Exclude error and warn messages printed out on the stderr by PMDK in debug +fgrep -v "*ERROR*" $LOG_TEMP | fgrep -v "*WARN*" > $LOG rm $LOG_TEMP check diff --git a/src/test/pmempool_sync/TEST23 b/src/test/pmempool_sync/TEST23 index a37ed0af7cd..923fccd3220 100755 --- a/src/test/pmempool_sync/TEST23 +++ b/src/test/pmempool_sync/TEST23 @@ -63,8 +63,8 @@ expect_normal_exit $PMEMPOOL$EXESUFFIX sync $POOLSET1 >> $LOG_TEMP # Check metadata using pmempool info dump_pool_info $POOLSET1 >> $LOG_TEMP -# Exclude error messages printed out on the stderr by PMDK in debug -fgrep -v "*ERROR*" $LOG_TEMP > $LOG +# Exclude error and warn messages printed out on the stderr by PMDK in debug +fgrep -v "*ERROR*" $LOG_TEMP | fgrep -v "*WARN*" > $LOG rm $LOG_TEMP check diff --git a/src/test/pmempool_sync/TEST24 b/src/test/pmempool_sync/TEST24 index 8784b2e31d5..dbbfecc5798 100755 --- a/src/test/pmempool_sync/TEST24 +++ b/src/test/pmempool_sync/TEST24 @@ -60,8 +60,8 @@ expect_normal_exit $PMEMPOOL$EXESUFFIX sync $POOLSET1 >> $LOG_TEMP # Check metadata using pmempool info dump_pool_info $POOLSET1 >> $LOG_TEMP -# Exclude error messages printed out on the stderr by PMDK in debug -fgrep -v "*ERROR*" $LOG_TEMP > $LOG +# Exclude error and warn messages printed out on the stderr by PMDK in debug +fgrep -v "*ERROR*" $LOG_TEMP | fgrep -v "*WARN*" | fgrep -v "*WARN*" > $LOG rm $LOG_TEMP check diff --git a/src/test/pmempool_sync/TEST29 b/src/test/pmempool_sync/TEST29 index e2adb8b9c9c..a73aa3b8f17 100755 --- a/src/test/pmempool_sync/TEST29 +++ b/src/test/pmempool_sync/TEST29 @@ -40,9 +40,9 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST32 b/src/test/pmempool_sync/TEST32 index c8e0836a754..fadb39e2271 100755 --- a/src/test/pmempool_sync/TEST32 +++ b/src/test/pmempool_sync/TEST32 @@ -50,9 +50,9 @@ expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX sync -b -v $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST33 b/src/test/pmempool_sync/TEST33 index 46048b4fd31..2ada861d978 100755 --- a/src/test/pmempool_sync/TEST33 +++ b/src/test/pmempool_sync/TEST33 @@ -50,9 +50,9 @@ expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX sync -b -v $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST34 b/src/test/pmempool_sync/TEST34 index 8a522a8b80a..d0d7d92571c 100755 --- a/src/test/pmempool_sync/TEST34 +++ b/src/test/pmempool_sync/TEST34 @@ -59,9 +59,9 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX sync -b -v $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST35 b/src/test/pmempool_sync/TEST35 index fc334b4ffee..856837f5182 100755 --- a/src/test/pmempool_sync/TEST35 +++ b/src/test/pmempool_sync/TEST35 @@ -59,9 +59,9 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX sync -b -v $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST36 b/src/test/pmempool_sync/TEST36 index f3899ede7de..827b588f75c 100755 --- a/src/test/pmempool_sync/TEST36 +++ b/src/test/pmempool_sync/TEST36 @@ -63,9 +63,9 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX sync -b -v $POOLSET >> $LOG" # sync was uneable to fix bad blocks, because one recovery file was missing expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST37 b/src/test/pmempool_sync/TEST37 index e12a5c86262..1e2dd7fd87a 100755 --- a/src/test/pmempool_sync/TEST37 +++ b/src/test/pmempool_sync/TEST37 @@ -63,9 +63,9 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX sync -b -v $POOLSET >> $LOG" # sync was uneable to fix bad blocks, because one recovery file was missing expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST42 b/src/test/pmempool_sync/TEST42 index aa4d6cf12b9..bbdf8eee097 100755 --- a/src/test/pmempool_sync/TEST42 +++ b/src/test/pmempool_sync/TEST42 @@ -62,9 +62,9 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST43 b/src/test/pmempool_sync/TEST43 index e456acbb989..d6c9cba7e3a 100755 --- a/src/test/pmempool_sync/TEST43 +++ b/src/test/pmempool_sync/TEST43 @@ -63,9 +63,9 @@ expect_abnormal_exit "$PMEMPOOL$EXESUFFIX sync -v -b $POOLSET &>> $LOG" # pool verification should fail expect_abnormal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST44 b/src/test/pmempool_sync/TEST44 index 5b2e1465ddd..534794c2144 100755 --- a/src/test/pmempool_sync/TEST44 +++ b/src/test/pmempool_sync/TEST44 @@ -82,9 +82,9 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST45 b/src/test/pmempool_sync/TEST45 index 9a48af2c01b..a3101b33425 100755 --- a/src/test/pmempool_sync/TEST45 +++ b/src/test/pmempool_sync/TEST45 @@ -80,9 +80,9 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST46 b/src/test/pmempool_sync/TEST46 index de57afa19ac..7268fbe034c 100755 --- a/src/test/pmempool_sync/TEST46 +++ b/src/test/pmempool_sync/TEST46 @@ -80,9 +80,9 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST47 b/src/test/pmempool_sync/TEST47 index 62ad2a7048a..d4eb0f2e589 100755 --- a/src/test/pmempool_sync/TEST47 +++ b/src/test/pmempool_sync/TEST47 @@ -83,9 +83,9 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST48 b/src/test/pmempool_sync/TEST48 index 31c22d6e69a..244e96f21ae 100755 --- a/src/test/pmempool_sync/TEST48 +++ b/src/test/pmempool_sync/TEST48 @@ -86,9 +86,9 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST49 b/src/test/pmempool_sync/TEST49 index c643f0a22c6..604dd765c24 100755 --- a/src/test/pmempool_sync/TEST49 +++ b/src/test/pmempool_sync/TEST49 @@ -85,9 +85,9 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST50 b/src/test/pmempool_sync/TEST50 index 9d9a5e05b67..f26241efb05 100755 --- a/src/test/pmempool_sync/TEST50 +++ b/src/test/pmempool_sync/TEST50 @@ -85,9 +85,9 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST51 b/src/test/pmempool_sync/TEST51 index 33c8f45dbcf..5bcf8548032 100755 --- a/src/test/pmempool_sync/TEST51 +++ b/src/test/pmempool_sync/TEST51 @@ -86,9 +86,9 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST52 b/src/test/pmempool_sync/TEST52 index fa608e1940a..5fee861d20f 100755 --- a/src/test/pmempool_sync/TEST52 +++ b/src/test/pmempool_sync/TEST52 @@ -83,9 +83,9 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST53 b/src/test/pmempool_sync/TEST53 index 5c09150ea50..2de6af42801 100755 --- a/src/test/pmempool_sync/TEST53 +++ b/src/test/pmempool_sync/TEST53 @@ -85,9 +85,9 @@ expect_normal_exit "$PMEMPOOL$EXESUFFIX check -v $POOLSET >> $LOG" expect_normal_exit "$PMEMPOOL$EXESUFFIX info --bad-blocks=yes $POOLSET >> $LOG" expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX v &>> $LOG" -# Exclude error messages printed out on the stderr by PMDK in debug +# Exclude error and warn messages printed out on the stderr by PMDK in debug LOG_TEMP=$LOG.log -fgrep -v "*ERROR*" $LOG > $LOG_TEMP +fgrep -v "*ERROR*" $LOG | fgrep -v "*WARN*" > $LOG_TEMP mv $LOG_TEMP $LOG check diff --git a/src/test/pmempool_sync/TEST8 b/src/test/pmempool_sync/TEST8 index 77897f32b91..6a0c54ca2c6 100755 --- a/src/test/pmempool_sync/TEST8 +++ b/src/test/pmempool_sync/TEST8 @@ -55,8 +55,8 @@ rm -f $DIR/part11 # Synchronize replicas using the second poolset expect_abnormal_exit $PMEMPOOL$EXESUFFIX sync $POOLSET2 >> $LOG_TEMP 2>&1 -# Exclude error messages printed out on the stderr by PMDK in debug -fgrep -v "*ERROR*" $LOG_TEMP > $LOG +# Exclude error and warn messages printed out on the stderr by PMDK in debug +fgrep -v "*ERROR*" $LOG_TEMP | fgrep -v "*WARN*" > $LOG rm $LOG_TEMP check diff --git a/src/test/pmempool_sync/TEST9 b/src/test/pmempool_sync/TEST9 index 9bb26f4d8fe..699acb4a692 100755 --- a/src/test/pmempool_sync/TEST9 +++ b/src/test/pmempool_sync/TEST9 @@ -58,8 +58,8 @@ rm -f $DIR/part01 # Try to synchronize replicas using the second poolset expect_abnormal_exit $PMEMPOOL$EXESUFFIX sync $POOLSET2 >> $LOG_TEMP 2>&1 -# Exclude error messages printed out on the stderr by PMDK in debug -fgrep -v "*ERROR*" $LOG_TEMP > $LOG +# Exclude error and warn messages printed out on the stderr by PMDK in debug +fgrep -v "*ERROR*" $LOG_TEMP | fgrep -v "*WARN*" > $LOG rm $LOG_TEMP check From 564b836b01c7689fcd99a64e1d37fdb9b98f83f1 Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Tue, 30 Jan 2024 17:46:24 +0100 Subject: [PATCH 3/6] common: CORE_LOG_WARNING_W_ERRNO integration Signed-off-by: Tomasz Gromadzki --- src/common/uuid_linux.c | 4 ++-- src/libpmemobj/obj.c | 6 +++--- src/libpmempool/rm.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/uuid_linux.c b/src/common/uuid_linux.c index 16ee2dae531..5755a0d4718 100644 --- a/src/common/uuid_linux.c +++ b/src/common/uuid_linux.c @@ -28,13 +28,13 @@ util_uuid_generate(uuid_t uuid) int fd = os_open(POOL_HDR_UUID_GEN_FILE, O_RDONLY); if (fd < 0) { /* Fatal error */ - CORE_LOG_WARNING("!open(uuid)"); + CORE_LOG_WARNING_W_ERRNO("open(uuid)"); return -1; } ssize_t num = read(fd, uu, POOL_HDR_UUID_STR_LEN); if (num < POOL_HDR_UUID_STR_LEN) { /* Fatal error */ - CORE_LOG_WARNING("!read(uuid)"); + CORE_LOG_WARNING_W_ERRNO("read(uuid)"); os_close(fd); return -1; } diff --git a/src/libpmemobj/obj.c b/src/libpmemobj/obj.c index a1eda31b54e..3025224b4ce 100644 --- a/src/libpmemobj/obj.c +++ b/src/libpmemobj/obj.c @@ -87,7 +87,7 @@ obj_ctl_init_and_load(PMEMobjpool *pop) LOG(3, "pop %p", pop); if (pop != NULL && (pop->ctl = ctl_new()) == NULL) { - CORE_LOG_WARNING("!ctl_new"); + CORE_LOG_WARNING_W_ERRNO("ctl_new"); return -1; } @@ -1186,7 +1186,7 @@ obj_check_basic_local(PMEMobjpool *pop, size_t mapped_size) } if ((errno = lane_check(pop)) != 0) { - CORE_LOG_WARNING("!lane_check"); + CORE_LOG_WARNING_W_ERRNO("lane_check"); consistent = 0; } @@ -1195,7 +1195,7 @@ obj_check_basic_local(PMEMobjpool *pop, size_t mapped_size) errno = palloc_heap_check((char *)pop + pop->heap_offset, heap_size); if (errno != 0) { - CORE_LOG_WARNING("!heap_check"); + CORE_LOG_WARNING_W_ERRNO("heap_check"); consistent = 0; } diff --git a/src/libpmempool/rm.c b/src/libpmempool/rm.c index cbb540249a0..425858c4970 100644 --- a/src/libpmempool/rm.c +++ b/src/libpmempool/rm.c @@ -20,7 +20,7 @@ #define ERR_F(f, ...) do {\ if (CHECK_FLAG((f), FORCE))\ - CORE_LOG_WARNING("!(ignored) " __VA_ARGS__);\ + CORE_LOG_WARNING_W_ERRNO("(ignored) " __VA_ARGS__);\ else\ ERR_WO_ERRNO(__VA_ARGS__);\ } while (0) From d9ca2f670131117b2b62ba1633aa520f9291357d Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Wed, 31 Jan 2024 13:00:11 +0100 Subject: [PATCH 4/6] common: addjust logging levels Signed-off-by: Tomasz Gromadzki --- src/common/file.c | 24 +++++++++---------- src/common/os_deep_linux.c | 2 +- src/common/set.c | 46 ++++++++++++++++++------------------- src/common/shutdown_state.c | 2 +- src/common/uuid.c | 12 +++++----- src/common/uuid_linux.c | 4 ++-- src/libpmem/pmem.c | 2 +- src/libpmemobj/heap.c | 2 +- src/libpmemobj/lane.c | 2 +- src/libpmemobj/list.c | 10 ++++---- src/libpmemobj/obj.c | 20 ++++++++-------- src/libpmempool/pool.c | 4 ++-- src/libpmempool/rm.c | 4 ++-- src/libpmempool/sync.c | 8 +++---- src/libpmempool/transform.c | 6 ++--- src/tools/pmempool/common.c | 2 +- 16 files changed, 75 insertions(+), 75 deletions(-) diff --git a/src/common/file.c b/src/common/file.c index b79cab02f44..b77c49c9bd2 100644 --- a/src/common/file.c +++ b/src/common/file.c @@ -209,13 +209,13 @@ util_file_map_whole(const char *path) ssize_t size = util_fd_get_size(fd); if (size < 0) { - CORE_LOG_WARNING("cannot determine file length \"%s\"", path); + CORE_LOG_ERROR("cannot determine file length \"%s\"", path); goto out; } addr = util_map(fd, 0, (size_t)size, MAP_SHARED, 0, 0, NULL); if (addr == NULL) { - CORE_LOG_WARNING("failed to map entire file \"%s\"", path); + CORE_LOG_ERROR("failed to map entire file \"%s\"", path); goto out; } @@ -247,13 +247,13 @@ util_file_zero(const char *path, os_off_t off, size_t len) ssize_t size = util_fd_get_size(fd); if (size < 0) { - CORE_LOG_WARNING("cannot determine file length \"%s\"", path); + CORE_LOG_ERROR("cannot determine file length \"%s\"", path); ret = -1; goto out; } if (off > size) { - CORE_LOG_WARNING("offset beyond file length, %ju > %ju", off, + CORE_LOG_ERROR("offset beyond file length, %ju > %ju", off, size); ret = -1; goto out; @@ -269,7 +269,7 @@ util_file_zero(const char *path, os_off_t off, size_t len) void *addr = util_map(fd, 0, (size_t)size, MAP_SHARED, 0, 0, NULL); if (addr == NULL) { - CORE_LOG_WARNING("failed to map entire file \"%s\"", path); + CORE_LOG_ERROR("failed to map entire file \"%s\"", path); ret = -1; goto out; } @@ -304,7 +304,7 @@ util_file_pwrite(const char *path, const void *buffer, size_t size, if (type == TYPE_NORMAL) { int fd = util_file_open(path, NULL, 0, O_RDWR); if (fd < 0) { - CORE_LOG_WARNING("failed to open file \"%s\"", path); + CORE_LOG_ERROR("failed to open file \"%s\"", path); return -1; } @@ -317,7 +317,7 @@ util_file_pwrite(const char *path, const void *buffer, size_t size, ssize_t file_size = util_file_get_size(path); if (file_size < 0) { - CORE_LOG_WARNING("cannot determine file length \"%s\"", path); + CORE_LOG_ERROR("cannot determine file length \"%s\"", path); return -1; } @@ -332,7 +332,7 @@ util_file_pwrite(const char *path, const void *buffer, size_t size, void *addr = util_file_map_whole(path); if (addr == NULL) { - CORE_LOG_WARNING("failed to map entire file \"%s\"", path); + CORE_LOG_ERROR("failed to map entire file \"%s\"", path); return -1; } @@ -358,7 +358,7 @@ util_file_pread(const char *path, void *buffer, size_t size, if (type == TYPE_NORMAL) { int fd = util_file_open(path, NULL, 0, O_RDONLY); if (fd < 0) { - CORE_LOG_WARNING("failed to open file \"%s\"", path); + CORE_LOG_ERROR("failed to open file \"%s\"", path); return -1; } @@ -371,7 +371,7 @@ util_file_pread(const char *path, void *buffer, size_t size, ssize_t file_size = util_file_get_size(path); if (file_size < 0) { - CORE_LOG_WARNING("cannot determine file length \"%s\"", path); + CORE_LOG_ERROR("cannot determine file length \"%s\"", path); return -1; } @@ -386,7 +386,7 @@ util_file_pread(const char *path, void *buffer, size_t size, void *addr = util_file_map_whole(path); if (addr == NULL) { - CORE_LOG_WARNING("failed to map entire file \"%s\"", path); + CORE_LOG_ERROR("failed to map entire file \"%s\"", path); return -1; } @@ -544,7 +544,7 @@ util_unlink_flock(const char *path) int fd = util_file_open(path, NULL, 0, O_RDONLY); if (fd < 0) { - CORE_LOG_WARNING("failed to open file \"%s\"", path); + CORE_LOG_ERROR("failed to open file \"%s\"", path); return -1; } diff --git a/src/common/os_deep_linux.c b/src/common/os_deep_linux.c index 4460832bc52..ce5dc011d04 100644 --- a/src/common/os_deep_linux.c +++ b/src/common/os_deep_linux.c @@ -39,7 +39,7 @@ os_deep_type(const struct map_tracker *mt, void *addr, size_t len) "deep_flush not supported"); } else { errno = pmem2_err_to_errno(ret); - CORE_LOG_WARNING( + CORE_LOG_ERROR( "cannot write to deep_flush in region %u", mt->region_id); } diff --git a/src/common/set.c b/src/common/set.c index ed5a7521912..57b78bc7723 100644 --- a/src/common/set.c +++ b/src/common/set.c @@ -340,7 +340,7 @@ util_poolset_open(struct pool_set *set) { for (unsigned r = 0; r < set->nreplicas; ++r) { if (util_replica_open(set, r, MAP_SHARED)) { - CORE_LOG_WARNING("replica open failed: replica %u", r); + CORE_LOG_ERROR("replica open failed: replica %u", r); errno = EINVAL; return -1; } @@ -1050,7 +1050,7 @@ util_poolset_directory_load(struct pool_replica **repp, const char *directory) ssize_t size = util_file_get_size(entry->path); if (size < 0) { - CORE_LOG_WARNING( + CORE_LOG_ERROR( "cannot read size of file (%s) in a poolset directory", entry->path); goto err; @@ -1481,7 +1481,7 @@ util_part_open(struct pool_set_part *part, size_t minsize, int create_part) part->fd = util_file_create(part->path, part->filesize, minsize); if (part->fd == -1) { - CORE_LOG_WARNING("failed to create file: %s", + CORE_LOG_ERROR("failed to create file: %s", part->path); return -1; } @@ -1491,7 +1491,7 @@ util_part_open(struct pool_set_part *part, size_t minsize, int create_part) int flags = O_RDWR; part->fd = util_file_open(part->path, &size, minsize, flags); if (part->fd == -1) { - CORE_LOG_WARNING("failed to open file: %s", part->path); + CORE_LOG_ERROR("failed to open file: %s", part->path); return -1; } @@ -1969,7 +1969,7 @@ util_replica_map_local(struct pool_set *set, unsigned repidx, int flags) /* map the first part and reserve space for remaining parts */ if (util_map_part(&rep->part[0], addr, rep->resvsize, 0, flags, 0) != 0) { - CORE_LOG_WARNING( + CORE_LOG_ERROR( "pool mapping failed - replica #%u part #0", repidx); return -1; @@ -2013,7 +2013,7 @@ util_replica_map_local(struct pool_set *set, unsigned repidx, int flags) munmap(addr, rep->resvsize - mapsize); break; } - CORE_LOG_WARNING( + CORE_LOG_ERROR( "usable space mapping failed - part #%d", p); goto err; @@ -2082,7 +2082,7 @@ util_replica_init_headers_local(struct pool_set *set, unsigned repidx, /* map all headers - don't care about the address */ for (unsigned p = 0; p < rep->nhdrs; p++) { if (util_map_hdr(&rep->part[p], flags, 0) != 0) { - CORE_LOG_WARNING("header mapping failed - part #%d", p); + CORE_LOG_ERROR("header mapping failed - part #%d", p); goto err; } } @@ -2090,7 +2090,7 @@ util_replica_init_headers_local(struct pool_set *set, unsigned repidx, /* create headers, set UUID's */ for (unsigned p = 0; p < rep->nhdrs; p++) { if (util_header_create(set, repidx, p, attr, 0) != 0) { - CORE_LOG_WARNING("header creation failed - part #%d", + CORE_LOG_ERROR("header creation failed - part #%d", p); goto err; } @@ -2127,7 +2127,7 @@ util_replica_create_local(struct pool_set *set, unsigned repidx, int flags, */ if (PART(REP(set, repidx), 0)->addr == NULL) { if (util_replica_map_local(set, repidx, flags) != 0) { - CORE_LOG_WARNING("replica #%u map failed", repidx); + CORE_LOG_ERROR("replica #%u map failed", repidx); return -1; } } @@ -2136,7 +2136,7 @@ util_replica_create_local(struct pool_set *set, unsigned repidx, int flags, return 0; if (util_replica_init_headers_local(set, repidx, flags, attr) != 0) { - CORE_LOG_WARNING("replica #%u headers initialization failed", + CORE_LOG_ERROR("replica #%u headers initialization failed", repidx); return -1; } @@ -2395,7 +2395,7 @@ util_pool_create_uuids(struct pool_set **setp, const char *path, int ret = util_poolset_create_set(setp, path, poolsize, minsize, IGNORE_SDS(attr)); if (ret < 0) { - CORE_LOG_WARNING("cannot create pool set -- '%s'", path); + CORE_LOG_ERROR("cannot create pool set -- '%s'", path); return -1; } @@ -2482,7 +2482,7 @@ util_pool_create_uuids(struct pool_set **setp, const char *path, /* generate pool set UUID */ ret = util_uuid_generate(set->uuid); if (ret < 0) { - CORE_LOG_WARNING( + CORE_LOG_ERROR( "cannot generate pool set UUID"); goto err_poolset; } @@ -2494,8 +2494,8 @@ util_pool_create_uuids(struct pool_set **setp, const char *path, for (unsigned i = 0; i < rep->nhdrs; i++) { ret = util_uuid_generate(rep->part[i].uuid); if (ret < 0) { - CORE_LOG_WARNING( - "cannot generate pool set part UUID"); + CORE_LOG_ERROR( + "cannot generate pool set part UUID"); goto err_poolset; } } @@ -2521,7 +2521,7 @@ util_pool_create_uuids(struct pool_set **setp, const char *path, for (unsigned r = 0; r < set->nreplicas; r++) { if (util_replica_create_local(set, r, flags, attr) != 0) { - CORE_LOG_WARNING("replica #%u creation failed", r); + CORE_LOG_ERROR("replica #%u creation failed", r); goto err_create; } } @@ -2598,7 +2598,7 @@ util_replica_open_local(struct pool_set *set, unsigned repidx, int flags) /* map the first part and reserve space for remaining parts */ if (util_map_part(&rep->part[0], addr, rep->resvsize, 0, flags, 0) != 0) { - CORE_LOG_WARNING( + CORE_LOG_ERROR( "pool mapping failed - replica #%u part #0", repidx); return -1; @@ -2612,7 +2612,7 @@ util_replica_open_local(struct pool_set *set, unsigned repidx, int flags) /* map all headers - don't care about the address */ for (unsigned p = 0; p < rep->nhdrs; p++) { if (util_map_hdr(&rep->part[p], flags, 0) != 0) { - CORE_LOG_WARNING( + CORE_LOG_ERROR( "header mapping failed - part #%d", p); goto err; } @@ -2659,7 +2659,7 @@ util_replica_open_local(struct pool_set *set, unsigned repidx, int flags) rep->resvsize); break; } - CORE_LOG_WARNING( + CORE_LOG_ERROR( "usable space mapping failed - part #%d", p); goto err; @@ -2790,7 +2790,7 @@ util_replica_check(struct pool_set *set, const struct pool_attr *attr) struct pool_replica *rep = set->replica[r]; for (unsigned p = 0; p < rep->nhdrs; p++) { if (util_header_check(set, r, p, attr) != 0) { - CORE_LOG_WARNING( + CORE_LOG_ERROR( "header check failed - part #%d", p); return -1; } @@ -2820,7 +2820,7 @@ util_replica_check(struct pool_set *set, const struct pool_attr *attr) ASSERTne(rep->nparts, 0); if (shutdown_state_check(&sds, &HDR(rep, 0)->sds, rep)) { - CORE_LOG_WARNING("ADR failure detected"); + CORE_LOG_ERROR("ADR failure detected"); errno = EINVAL; return -1; } @@ -2913,7 +2913,7 @@ util_pool_open_nocheck(struct pool_set *set, unsigned flags) for (unsigned r = 0; r < set->nreplicas; r++) { if (util_replica_open(set, r, mmap_flags) != 0) { - CORE_LOG_WARNING("replica #%u open failed", r); + CORE_LOG_ERROR("replica #%u open failed", r); goto err_replica; } } @@ -3004,7 +3004,7 @@ util_pool_open(struct pool_set **setp, const char *path, size_t minpartsize, int ret = util_poolset_create_set(setp, path, 0, 0, flags & POOL_OPEN_IGNORE_SDS); if (ret < 0) { - CORE_LOG_WARNING("cannot open pool set -- '%s'", path); + CORE_LOG_ERROR("cannot open pool set -- '%s'", path); return -1; } @@ -3076,7 +3076,7 @@ util_pool_open(struct pool_set **setp, const char *path, size_t minpartsize, for (unsigned r = 0; r < set->nreplicas; r++) { if (util_replica_open(set, r, mmap_flags) != 0) { - CORE_LOG_WARNING("replica #%u open failed", r); + CORE_LOG_ERROR("replica #%u open failed", r); goto err_replica; } } diff --git a/src/common/shutdown_state.c b/src/common/shutdown_state.c index 66d20e5dd52..fb101d38e56 100644 --- a/src/common/shutdown_state.c +++ b/src/common/shutdown_state.c @@ -77,7 +77,7 @@ shutdown_state_add_part(struct shutdown_state *sds, int fd, ERR_WO_ERRNO( "Cannot read unsafe shutdown count. For more information please check https://github.com/pmem/pmdk/issues/4207"); } - CORE_LOG_WARNING("cannot read unsafe shutdown count for %d", + CORE_LOG_ERROR("cannot read unsafe shutdown count for %d", fd); goto err; } diff --git a/src/common/uuid.c b/src/common/uuid.c index c1c084c82e3..c92de54c8c6 100644 --- a/src/common/uuid.c +++ b/src/common/uuid.c @@ -20,12 +20,12 @@ util_uuid_to_string(const uuid_t u, char *buf) int len; /* size that is returned from sprintf call */ if (buf == NULL) { - CORE_LOG_WARNING("invalid buffer for uuid string"); + CORE_LOG_ERROR("invalid buffer for uuid string"); return -1; } if (u == NULL) { - CORE_LOG_WARNING("invalid uuid structure"); + CORE_LOG_ERROR("invalid uuid structure"); return -1; } @@ -38,7 +38,7 @@ util_uuid_to_string(const uuid_t u, char *buf) uuid->node[5]); if (len != POOL_HDR_UUID_STR_LEN - 1) { - CORE_LOG_WARNING("snprintf(uuid): %d", len); + CORE_LOG_ERROR("snprintf(uuid): %d", len); return -1; } @@ -56,13 +56,13 @@ int util_uuid_from_string(const char uuid[POOL_HDR_UUID_STR_LEN], struct uuid *ud) { if (strlen(uuid) != 36) { - CORE_LOG_WARNING("invalid uuid string"); + CORE_LOG_ERROR("invalid uuid string"); return -1; } if (uuid[8] != '-' || uuid[13] != '-' || uuid[18] != '-' || uuid[23] != '-') { - CORE_LOG_WARNING("invalid uuid string"); + CORE_LOG_ERROR("invalid uuid string"); return -1; } @@ -75,7 +75,7 @@ util_uuid_from_string(const char uuid[POOL_HDR_UUID_STR_LEN], struct uuid *ud) &ud->node[5]); if (n != 11) { - CORE_LOG_WARNING("sscanf(uuid)"); + CORE_LOG_ERROR("sscanf(uuid)"); return -1; } diff --git a/src/common/uuid_linux.c b/src/common/uuid_linux.c index 5755a0d4718..82d0a8dbcb7 100644 --- a/src/common/uuid_linux.c +++ b/src/common/uuid_linux.c @@ -28,13 +28,13 @@ util_uuid_generate(uuid_t uuid) int fd = os_open(POOL_HDR_UUID_GEN_FILE, O_RDONLY); if (fd < 0) { /* Fatal error */ - CORE_LOG_WARNING_W_ERRNO("open(uuid)"); + CORE_LOG_ERROR_WITH_ERRNO("open(uuid)"); return -1; } ssize_t num = read(fd, uu, POOL_HDR_UUID_STR_LEN); if (num < POOL_HDR_UUID_STR_LEN) { /* Fatal error */ - CORE_LOG_WARNING_W_ERRNO("read(uuid)"); + CORE_LOG_ERROR_WITH_ERRNO("read(uuid)"); os_close(fd); return -1; } diff --git a/src/libpmem/pmem.c b/src/libpmem/pmem.c index c552a246f67..1078d14eec1 100644 --- a/src/libpmem/pmem.c +++ b/src/libpmem/pmem.c @@ -477,7 +477,7 @@ pmem_map_fileU(const char *path, size_t len, int flags, if ((fd = util_tmpfile(path, OS_DIR_SEP_STR"pmem.XXXXXX", open_flags & O_EXCL)) < 0) { - CORE_LOG_WARNING( + CORE_LOG_ERROR( "failed to create temporary file at \"%s\"", path); return NULL; diff --git a/src/libpmemobj/heap.c b/src/libpmemobj/heap.c index 78900137dfc..d0b02f6fa18 100644 --- a/src/libpmemobj/heap.c +++ b/src/libpmemobj/heap.c @@ -1324,7 +1324,7 @@ heap_set_narenas_max(struct palloc_heap *heap, unsigned size) util_mutex_lock(&h->arenas.lock); unsigned capacity = (unsigned)VEC_CAPACITY(&h->arenas.vec); if (size < capacity) { - CORE_LOG_WARNING("cannot decrease max number of arenas"); + CORE_LOG_ERROR("cannot decrease max number of arenas"); goto out; } else if (size == capacity) { ret = 0; diff --git a/src/libpmemobj/lane.c b/src/libpmemobj/lane.c index 00ab7f3820d..fee0bfed92b 100644 --- a/src/libpmemobj/lane.c +++ b/src/libpmemobj/lane.c @@ -414,7 +414,7 @@ lane_check(PMEMobjpool *pop) layout = lane_get_layout(pop, j); if (ulog_check((struct ulog *)&layout->internal, OBJ_OFF_IS_VALID_FROM_CTX, &pop->p_ops) != 0) { - CORE_LOG_WARNING( + CORE_LOG_ERROR( "lane %" PRIu64 " internal redo failed: %d", j, err); return err; diff --git a/src/libpmemobj/list.c b/src/libpmemobj/list.c index 01185130833..614d38fbd4c 100644 --- a/src/libpmemobj/list.c +++ b/src/libpmemobj/list.c @@ -561,7 +561,7 @@ list_insert_new_user(PMEMobjpool *pop, int ret; if ((ret = pmemobj_mutex_lock(pop, &user_head->lock))) { errno = ret; - CORE_LOG_WARNING("pmemobj_mutex_lock failed"); + CORE_LOG_ERROR("pmemobj_mutex_lock failed"); return -1; } @@ -600,7 +600,7 @@ list_insert(PMEMobjpool *pop, if ((ret = pmemobj_mutex_lock(pop, &head->lock))) { errno = ret; - CORE_LOG_WARNING("pmemobj_mutex_lock failed"); + CORE_LOG_ERROR("pmemobj_mutex_lock failed"); ret = -1; goto err; } @@ -728,7 +728,7 @@ list_remove_free_user(PMEMobjpool *pop, size_t pe_offset, int ret; if ((ret = pmemobj_mutex_lock(pop, &user_head->lock))) { errno = ret; - CORE_LOG_WARNING("pmemobj_mutex_lock failed"); + CORE_LOG_ERROR("pmemobj_mutex_lock failed"); return -1; } @@ -762,7 +762,7 @@ list_remove(PMEMobjpool *pop, if ((ret = pmemobj_mutex_lock(pop, &head->lock))) { errno = ret; - CORE_LOG_WARNING("pmemobj_mutex_lock failed"); + CORE_LOG_ERROR("pmemobj_mutex_lock failed"); ret = -1; goto err; } @@ -839,7 +839,7 @@ list_move(PMEMobjpool *pop, */ if ((ret = list_mutexes_lock(pop, head_new, head_old))) { errno = ret; - CORE_LOG_WARNING("list_mutexes_lock failed"); + CORE_LOG_ERROR("list_mutexes_lock failed"); ret = -1; goto err; } diff --git a/src/libpmemobj/obj.c b/src/libpmemobj/obj.c index 3025224b4ce..077a6f581ba 100644 --- a/src/libpmemobj/obj.c +++ b/src/libpmemobj/obj.c @@ -87,7 +87,7 @@ obj_ctl_init_and_load(PMEMobjpool *pop) LOG(3, "pop %p", pop); if (pop != NULL && (pop->ctl = ctl_new()) == NULL) { - CORE_LOG_WARNING_W_ERRNO("ctl_new"); + CORE_LOG_ERROR_WITH_ERRNO("ctl_new"); return -1; } @@ -102,7 +102,7 @@ obj_ctl_init_and_load(PMEMobjpool *pop) if (env_config != NULL) { if (ctl_load_config_from_string(pop ? pop->ctl : NULL, pop, env_config) != 0) { - CORE_LOG_WARNING( + CORE_LOG_ERROR( "unable to parse config stored in %s environment variable", OBJ_CONFIG_ENV_VARIABLE); goto err; @@ -113,7 +113,7 @@ obj_ctl_init_and_load(PMEMobjpool *pop) if (env_config_file != NULL && env_config_file[0] != '\0') { if (ctl_load_config_from_file(pop ? pop->ctl : NULL, pop, env_config_file) != 0) { - CORE_LOG_WARNING( + CORE_LOG_ERROR( "unable to parse config stored in %s file (from %s environment variable)", env_config_file, OBJ_CONFIG_FILE_ENV_VARIABLE); goto err; @@ -1087,7 +1087,7 @@ pmemobj_createU(const char *path, const char *layout, if (util_pool_create(&set, path, poolsize, PMEMOBJ_MIN_POOL, PMEMOBJ_MIN_PART, &adj_pool_attr, &runtime_nlanes, REPLICAS_ENABLED) != 0) { - CORE_LOG_WARNING("cannot create pool or pool set"); + CORE_LOG_ERROR("cannot create pool or pool set"); os_mutex_unlock(&pools_mutex); return NULL; } @@ -1124,7 +1124,7 @@ pmemobj_createU(const char *path, const char *layout, /* create pool descriptor */ if (obj_descr_create(pop, layout, set->poolsize) != 0) { - CORE_LOG_WARNING("creation of pool descriptor failed"); + CORE_LOG_ERROR("creation of pool descriptor failed"); goto err; } @@ -1186,7 +1186,7 @@ obj_check_basic_local(PMEMobjpool *pop, size_t mapped_size) } if ((errno = lane_check(pop)) != 0) { - CORE_LOG_WARNING_W_ERRNO("lane_check"); + CORE_LOG_ERROR_WITH_ERRNO("lane_check"); consistent = 0; } @@ -1195,7 +1195,7 @@ obj_check_basic_local(PMEMobjpool *pop, size_t mapped_size) errno = palloc_heap_check((char *)pop + pop->heap_offset, heap_size); if (errno != 0) { - CORE_LOG_WARNING_W_ERRNO("heap_check"); + CORE_LOG_ERROR_WITH_ERRNO("heap_check"); consistent = 0; } @@ -1235,7 +1235,7 @@ obj_pool_open(struct pool_set **set, const char *path, unsigned flags, { if (util_pool_open(set, path, PMEMOBJ_MIN_PART, &Obj_open_attr, nlanes, NULL, flags) != 0) { - CORE_LOG_WARNING("cannot open pool or pool set"); + CORE_LOG_ERROR("cannot open pool or pool set"); return -1; } @@ -1372,7 +1372,7 @@ obj_open_common(const char *path, const char *layout, unsigned flags, int boot) PMEMobjpool *rep = repset->part[0].addr; /* check descriptor */ if (obj_descr_check(rep, layout, set->poolsize) != 0) { - CORE_LOG_WARNING( + CORE_LOG_ERROR( "descriptor check of replica #%u failed", r); goto err_descr_check; } @@ -2435,7 +2435,7 @@ pmemobj_root_construct(PMEMobjpool *pop, size_t size, if (size > pop->root_size && obj_alloc_root(pop, size, constructor, arg)) { pmemobj_mutex_unlock_nofail(pop, &pop->rootlock); - CORE_LOG_WARNING("obj_realloc_root failed"); + CORE_LOG_ERROR("obj_realloc_root failed"); PMEMOBJ_API_END(); return OID_NULL; } diff --git a/src/libpmempool/pool.c b/src/libpmempool/pool.c index d4b734d2619..9ccc432ee86 100644 --- a/src/libpmempool/pool.c +++ b/src/libpmempool/pool.c @@ -187,7 +187,7 @@ pool_params_parse(const PMEMpoolcheck *ppc, struct pool_params *params, ret = util_poolset_create_set(&set, ppc->path, 0, 0, true); if (ret < 0) { - CORE_LOG_WARNING("cannot open pool set -- '%s'", + CORE_LOG_ERROR("cannot open pool set -- '%s'", ppc->path); return -1; } @@ -296,7 +296,7 @@ pool_set_file_open(const char *fname, int rdonly) int ret = util_poolset_create_set(&file->poolset, path, 0, 0, true); if (ret < 0) { - CORE_LOG_WARNING("cannot open pool set -- '%s'", path); + CORE_LOG_ERROR("cannot open pool set -- '%s'", path); goto err_free_fname; } unsigned flags = (rdonly ? POOL_OPEN_COW : 0) | diff --git a/src/libpmempool/rm.c b/src/libpmempool/rm.c index 425858c4970..480b3fa79cb 100644 --- a/src/libpmempool/rm.c +++ b/src/libpmempool/rm.c @@ -122,11 +122,11 @@ pmempool_rmU(const char *path, unsigned flags) } if (!is_poolset) { - CORE_LOG_WARNING("%s: not a poolset file", path); + CORE_LOG_ERROR("%s: not a poolset file", path); return rm_local(path, flags, 0); } - CORE_LOG_WARNING("%s: poolset file", path); + CORE_LOG_ERROR("%s: poolset file", path); /* fill up pool_set structure */ struct pool_set *set = NULL; diff --git a/src/libpmempool/sync.c b/src/libpmempool/sync.c index 2f9b7672480..ad1bedd2bb8 100644 --- a/src/libpmempool/sync.c +++ b/src/libpmempool/sync.c @@ -41,7 +41,7 @@ validate_args(struct pool_set *set) * (now replication works only for pmemobj pools) */ if (replica_check_part_sizes(set, PMEMOBJ_MIN_POOL)) { - CORE_LOG_WARNING("part sizes check failed"); + CORE_LOG_ERROR("part sizes check failed"); goto err; } @@ -49,7 +49,7 @@ validate_args(struct pool_set *set) * check if all directories for part files exist */ if (replica_check_part_dirs(set)) { - CORE_LOG_WARNING("part directories check failed"); + CORE_LOG_ERROR("part directories check failed"); goto err; } @@ -851,14 +851,14 @@ recreate_broken_parts(struct pool_set *set, /* remove parts from broken replica */ if (replica_remove_part(set, r, p, fix_bad_blocks)) { - CORE_LOG_WARNING("cannot remove part"); + CORE_LOG_ERROR("cannot remove part"); return -1; } /* create removed part and open it */ if (util_part_open(&broken_r->part[p], 0, 1 /* create */)) { - CORE_LOG_WARNING("cannot open/create parts"); + CORE_LOG_ERROR("cannot open/create parts"); return -1; } diff --git a/src/libpmempool/transform.c b/src/libpmempool/transform.c index 3a671dc14f6..b0785b02c7f 100644 --- a/src/libpmempool/transform.c +++ b/src/libpmempool/transform.c @@ -374,13 +374,13 @@ identify_transform_operation(struct poolset_compare_status *set_in_s, for (unsigned r = 0; r < set_in_s->nreplicas; ++r) { unsigned c = replica_counterpart(r, set_in_s); if (c != UNDEF_REPLICA) { - CORE_LOG_WARNING("replica %u has a counterpart %u", r, + CORE_LOG_DEBUG("replica %u has a counterpart %u", r, set_in_s->replica[r]); has_replica_to_keep = 1; REP_HEALTH(set_out_hs, c)->pool_size = REP_HEALTH(set_in_hs, r)->pool_size; } else { - CORE_LOG_WARNING("replica %u has no counterpart", r); + CORE_LOG_NOTICE("replica %u has no counterpart", r); is_removing_replicas = 1; } } @@ -394,7 +394,7 @@ identify_transform_operation(struct poolset_compare_status *set_in_s, /* check if there are replicas to be added */ for (unsigned r = 0; r < set_out_s->nreplicas; ++r) { if (replica_counterpart(r, set_out_s) == UNDEF_REPLICA) { - CORE_LOG_WARNING( + CORE_LOG_NOTICE( "Replica %u from output set has no counterpart", r); if (is_removing_replicas) { diff --git a/src/tools/pmempool/common.c b/src/tools/pmempool/common.c index 88ebc8419ca..c814380599f 100644 --- a/src/tools/pmempool/common.c +++ b/src/tools/pmempool/common.c @@ -1304,7 +1304,7 @@ util_pool_clear_badblocks(const char *path, int create) int ret = util_poolset_create_set(&setp, path, 0, 0, POOL_OPEN_IGNORE_SDS); if (ret < 0) { - CORE_LOG_WARNING("cannot open pool set -- '%s'", path); + CORE_LOG_ERROR("cannot open pool set -- '%s'", path); return -1; } From f7a0fb58b77fd7c8254c76b0534be3274f06b2fa Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Wed, 31 Jan 2024 13:09:39 +0100 Subject: [PATCH 5/6] common: adjust tests --- src/test/pmempool_sync/TEST24 | 2 +- src/test/pmempool_transform/TEST5 | 4 ++-- src/test/pmempool_transform/TEST6 | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/pmempool_sync/TEST24 b/src/test/pmempool_sync/TEST24 index dbbfecc5798..e70d3e2ef00 100755 --- a/src/test/pmempool_sync/TEST24 +++ b/src/test/pmempool_sync/TEST24 @@ -61,7 +61,7 @@ expect_normal_exit $PMEMPOOL$EXESUFFIX sync $POOLSET1 >> $LOG_TEMP dump_pool_info $POOLSET1 >> $LOG_TEMP # Exclude error and warn messages printed out on the stderr by PMDK in debug -fgrep -v "*ERROR*" $LOG_TEMP | fgrep -v "*WARN*" | fgrep -v "*WARN*" > $LOG +fgrep -v "*ERROR*" $LOG_TEMP | fgrep -v "*WARN*" > $LOG rm $LOG_TEMP check diff --git a/src/test/pmempool_transform/TEST5 b/src/test/pmempool_transform/TEST5 index 8cbf7e86b42..47541d1a92c 100755 --- a/src/test/pmempool_transform/TEST5 +++ b/src/test/pmempool_transform/TEST5 @@ -92,8 +92,8 @@ dump_pool_info $DIR/testfile01 >> $LOG_TEMP dump_pool_info $DIR/testfile02 >> $LOG_TEMP dump_pool_info $DIR/testfile10 >> $LOG_TEMP -# Exclude error and warning messages printed out on the stderr by PMDK in debug -grep -v -E "\*ERROR\*|\*WARN\*" $LOG_TEMP > $LOG +# Exclude error and warn messages printed out on the stderr by PMDK in debug +fgrep -v "*ERROR*" $LOG_TEMP | fgrep -v "*WARN*" > $LOG rm $LOG_TEMP check diff --git a/src/test/pmempool_transform/TEST6 b/src/test/pmempool_transform/TEST6 index a09722b3e0d..420a5f03ab8 100755 --- a/src/test/pmempool_transform/TEST6 +++ b/src/test/pmempool_transform/TEST6 @@ -71,8 +71,8 @@ expect_abnormal_exit $PMEMPOOL$EXESUFFIX transform \ # Check metadata by pmempool info dump_pool_info $POOLSET_OUT1 >> $LOG_TEMP -# Exclude error and warning messages printed out on the stderr by PMDK in debug -grep -v -E "\*ERROR\*|\*WARN\*" $LOG_TEMP > $LOG +# Exclude error and warn messages printed out on the stderr by PMDK in debug +fgrep -v "*ERROR*" $LOG_TEMP | fgrep -v "*WARN*" > $LOG rm $LOG_TEMP check From 506a7ffde9c7e45bcdf73e15108a451e2d88781e Mon Sep 17 00:00:00 2001 From: Jan Michalski Date: Mon, 5 Feb 2024 18:49:10 -0500 Subject: [PATCH 6/6] test: adjust tests (part 2) Signed-off-by: Jan Michalski --- src/test/util_poolset/grep0.log.match | 16 ++++++++++++++++ src/test/util_poolset/grep1.log.match | 12 ++++++++++++ src/test/util_poolset/grep2.log.match | 10 ++++++++++ src/test/util_poolset/grep6.log.match | 7 +++++++ 4 files changed, 45 insertions(+) diff --git a/src/test/util_poolset/grep0.log.match b/src/test/util_poolset/grep0.log.match index 65444a345ac..6790b813cff 100644 --- a/src/test/util_poolset/grep0.log.match +++ b/src/test/util_poolset/grep0.log.match @@ -8,6 +8,7 @@ $(OPT)compiled with support for Valgrind drd $(OPT)compiled with support for shutdown state $(OPT)compiled with libndctl 63+ open "$(nW)/testset0": No such file or directory +cannot create pool set -- '$(nW)/testset0' $(OPT)Cannot read device usc - ndctl is not available $(OPT)Unsafe shutdown count is not supported for this source $(OPT)Cannot read device usc - ndctl is not available @@ -19,17 +20,32 @@ $(OPT)Unsafe shutdown count is not supported for this source $(OPT)Cannot read device usc - ndctl is not available $(OPT)Unsafe shutdown count is not supported for this source size 1000000 smaller than 2097152 +failed to create file: $(nW)/testfile41 size 1000000 smaller than 2097152 +failed to create file: $(nW)/testfile52 open "$(nW)/nodir/testfile62": No such file or directory +failed to create file: $(nW)/testfile62 open "/proc/testfile72": Permission denied +failed to create file: /proc/testfile72 posix_fallocate "$(nW)/testfile82", 1073741824: No space left on device +failed to create file: $(nW)/testfile82 open "$(nW)/testfile102": Permission denied +failed to open file: $(nW)/testfile102 file size does not match config: $(nW)testfile113, 4194304 != 1048576 size 12288 smaller than 2097152 +failed to open file: $(nW)/testfile122 size 12288 smaller than 2097152 +failed to open file: $(nW)/testfile131 file size does not match config: $(nW)testfile142, 4194304 != 8388608 file size does not match config: $(nW)testfile152, 3145728 != 4194304 Non-empty file detected +header creation failed - part #1 +replica #0 headers initialization failed +replica #0 creation failed Non-empty file detected +header creation failed - part #0 +replica #0 headers initialization failed +replica #0 creation failed open "$(nW)/testset23": Permission denied +cannot create pool set -- '$(nW)/testset23' reservation pool size 1048576 smaller than 4194304 diff --git a/src/test/util_poolset/grep1.log.match b/src/test/util_poolset/grep1.log.match index 388f7f6909f..7dcf42462b5 100644 --- a/src/test/util_poolset/grep1.log.match +++ b/src/test/util_poolset/grep1.log.match @@ -8,16 +8,28 @@ $(OPT)compiled with support for Valgrind drd $(OPT)compiled with support for shutdown state $(OPT)compiled with libndctl 63+ open "$(nW)/testset0": No such file or directory +cannot open pool set -- '$(nW)/testset0' invalid major version (0) +header check failed - part #0 open "$(nW)/testset2": Permission denied +cannot open pool set -- '$(nW)/testset2' open "$(nW)/testfile31": No such file or directory +failed to open file: $(nW)/testfile31 open "$(nW)/testfile32": No such file or directory +failed to open file: $(nW)/testfile32 open "$(nW)/testfile31": No such file or directory +failed to open file: $(nW)/testfile31 open "$(nW)/testfile42": No such file or directory +failed to open file: $(nW)/testfile42 size 1048576 smaller than 2097152 +failed to open file: $(nW)/testfile51 size 1048576 smaller than 2097152 +failed to open file: $(nW)/testfile62 size 2097151 smaller than 2097152 +failed to open file: $(nW)/testfile71 open "$(nW)/testfile82": Permission denied +failed to open file: $(nW)/testfile82 file size does not match config: $(nW)testfile92, 4194304 != 65536 file size does not match config: $(nW)testfile102, 4194303 != 4194304 invalid major version (0) +header check failed - part #0 diff --git a/src/test/util_poolset/grep2.log.match b/src/test/util_poolset/grep2.log.match index f7d99cc936f..6d25e56c110 100644 --- a/src/test/util_poolset/grep2.log.match +++ b/src/test/util_poolset/grep2.log.match @@ -8,18 +8,28 @@ $(OPT)compiled with support for Valgrind drd $(OPT)compiled with support for shutdown state $(OPT)compiled with libndctl 63+ invalid checksum of pool header +header check failed - part #1 wrong pool type: "ERRORXX" +header check failed - part #1 pool version 99 (library expects 1) +header check failed - part #1 invalid reserved values invalid machine value invalid data value invalid machine_class value invalid alignment_desc value wrong architecture flags +header check failed - part #1 incompatible feature flags +header check failed - part #1 incompatible feature flags +header check failed - part #1 incompatible feature flags +header check failed - part #1 wrong pool set UUID +header check failed - part #1 wrong part UUID +header check failed - part #0 wrong part UUID +header check failed - part #0 wrong replica UUID diff --git a/src/test/util_poolset/grep6.log.match b/src/test/util_poolset/grep6.log.match index 08bd647a7e5..536bfdc581b 100644 --- a/src/test/util_poolset/grep6.log.match +++ b/src/test/util_poolset/grep6.log.match @@ -8,9 +8,16 @@ $(OPT)compiled with support for Valgrind drd $(OPT)compiled with support for shutdown state $(OPT)compiled with libndctl 63+ cannot mix directories and files in a set +cannot create pool set -- '$(nW)/testset2' cannot mix directories and files in a set +cannot create pool set -- '$(nW)/testset3' cannot mix directories and files in a set +cannot create pool set -- '$(nW)/testset4' cannot mix directories and files in a set +cannot create pool set -- '$(nW)/testset6' cannot mix directories and files in a set +cannot create pool set -- '$(nW)/testset7' cannot mix directories and files in a set +cannot create pool set -- '$(nW)/testset8' cannot mix directories and files in a set +cannot create pool set -- '$(nW)/testset9'