blob: log blob ID as hex

Blob IDs are sequentially assigned starting at 0x100000000.  When
debugging with a small number of blob IDs, it is much more intuitive to
see blob ID 0x100000000 rather than blob ID 4294967296.

In commit 76a577b082 a similar change was
made to blobcli.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Ic5321a83b57cf8c9f8df48cd424a926b6fec4ba8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14963
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Mike Gerdts 2022-10-07 08:37:55 -05:00 committed by Tomasz Zawadzki
parent 69038a944d
commit f4dc558245

View File

@ -170,7 +170,8 @@ bs_allocate_cluster(struct spdk_blob *blob, uint32_t cluster_num,
}
}
SPDK_DEBUGLOG(blob, "Claiming cluster %" PRIu64 " for blob %" PRIu64 "\n", *cluster, blob->id);
SPDK_DEBUGLOG(blob, "Claiming cluster %" PRIu64 " for blob 0x%" PRIx64 "\n", *cluster,
blob->id);
if (update_map) {
blob_insert_cluster(blob, cluster_num, *cluster);
@ -2142,7 +2143,8 @@ blob_persist_generate_new_md(struct spdk_blob_persist_ctx *ctx)
ctx->pages[i - 1].crc = blob_md_page_calc_crc(&ctx->pages[i - 1]);
blob->active.pages[i] = page_num;
bs_claim_md_page(bs, page_num);
SPDK_DEBUGLOG(blob, "Claiming page %u for blob %" PRIu64 "\n", page_num, blob->id);
SPDK_DEBUGLOG(blob, "Claiming page %u for blob 0x%" PRIx64 "\n", page_num,
blob->id);
page_num++;
}
spdk_spin_unlock(&bs->used_lock);
@ -4372,7 +4374,7 @@ bs_load_replay_md_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno)
bs_claim_md_page(ctx->bs, page_num);
spdk_spin_unlock(&ctx->bs->used_lock);
if (page->sequence_num == 0) {
SPDK_NOTICELOG("Recover: blob %" PRIu32 "\n", page_num);
SPDK_NOTICELOG("Recover: blob 0x%" PRIx32 "\n", page_num);
spdk_bit_array_set(ctx->bs->used_blobids, page_num);
}
if (bs_load_replay_md_parse_page(ctx, page)) {
@ -6669,7 +6671,7 @@ spdk_blob_resize(struct spdk_blob *blob, uint64_t sz, spdk_blob_op_complete cb_f
blob_verify_md_op(blob);
SPDK_DEBUGLOG(blob, "Resizing blob %" PRIu64 " to %" PRIu64 " clusters\n", blob->id, sz);
SPDK_DEBUGLOG(blob, "Resizing blob 0x%" PRIx64 " to %" PRIu64 " clusters\n", blob->id, sz);
if (blob->md_ro) {
cb_fn(cb_arg, -EPERM);
@ -7238,7 +7240,7 @@ spdk_bs_delete_blob(struct spdk_blob_store *bs, spdk_blob_id blobid,
struct spdk_bs_cpl cpl;
spdk_bs_sequence_t *seq;
SPDK_DEBUGLOG(blob, "Deleting blob %" PRIu64 "\n", blobid);
SPDK_DEBUGLOG(blob, "Deleting blob 0x%" PRIx64 "\n", blobid);
assert(spdk_get_thread() == bs->md_thread);
@ -7325,7 +7327,7 @@ bs_open_blob(struct spdk_blob_store *bs,
spdk_bs_sequence_t *seq;
uint32_t page_num;
SPDK_DEBUGLOG(blob, "Opening blob %" PRIu64 "\n", blobid);
SPDK_DEBUGLOG(blob, "Opening blob 0x%" PRIx64 "\n", blobid);
assert(spdk_get_thread() == bs->md_thread);
page_num = bs_blobid_to_page(blobid);
@ -7438,7 +7440,7 @@ spdk_blob_sync_md(struct spdk_blob *blob, spdk_blob_op_complete cb_fn, void *cb_
{
blob_verify_md_op(blob);
SPDK_DEBUGLOG(blob, "Syncing blob %" PRIu64 "\n", blob->id);
SPDK_DEBUGLOG(blob, "Syncing blob 0x%" PRIx64 "\n", blob->id);
if (blob->md_ro) {
assert(blob->state == SPDK_BLOB_STATE_CLEAN);
@ -7637,7 +7639,7 @@ spdk_blob_close(struct spdk_blob *blob, spdk_blob_op_complete cb_fn, void *cb_ar
blob_verify_md_op(blob);
SPDK_DEBUGLOG(blob, "Closing blob %" PRIu64 "\n", blob->id);
SPDK_DEBUGLOG(blob, "Closing blob 0x%" PRIx64 "\n", blob->id);
if (blob->open_ref == 0) {
cb_fn(cb_arg, -EBADF);