Commit 92b5ebe0 authored by Kozlowski Mateusz's avatar Kozlowski Mateusz Committed by Konrad Sztyber
Browse files

FTL: Dump statistics on shutdown



Signed-off-by: default avatarKozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: default avatarArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I9168af3cacffe9c4efae169b56df974a35bd4e2c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13296


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 5022d8f3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ CFLAGS += -I.

FTL_SUBDIRS := mngt utils

C_SRCS = ftl_core.c ftl_init.c ftl_layout.c
C_SRCS = ftl_core.c ftl_init.c ftl_layout.c ftl_debug.c
C_SRCS += mngt/ftl_mngt.c mngt/ftl_mngt_bdev.c mngt/ftl_mngt_shutdown.c mngt/ftl_mngt_startup.c
C_SRCS += mngt/ftl_mngt_md.c mngt/ftl_mngt_misc.c
C_SRCS += utils/ftl_conf.c utils/ftl_md.c
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
#include "spdk/crc32.h"

#include "ftl_core.h"
#include "ftl_debug.h"
#include "ftl_internal.h"
#include "mngt/ftl_mngt.h"

lib/ftl/ftl_debug.c

0 → 100644
+19 −0
Original line number Diff line number Diff line
/*   SPDX-License-Identifier: BSD-3-Clause
 *   Copyright (c) Intel Corporation.
 *   All rights reserved.
 */

#include "spdk/ftl.h"
#include "ftl_debug.h"

void
ftl_dev_dump_stats(const struct spdk_ftl_dev *dev)
{
	size_t total = 0;
	char uuid[SPDK_UUID_STRING_LEN];

	spdk_uuid_fmt_lower(uuid, sizeof(uuid), &dev->conf.uuid);
	FTL_NOTICELOG(dev, "\n");
	FTL_NOTICELOG(dev, "device UUID:         %s\n", uuid);
	FTL_NOTICELOG(dev, "total valid LBAs:    %zu\n", total);
}

lib/ftl/ftl_debug.h

0 → 100644
+14 −0
Original line number Diff line number Diff line
/*   SPDX-License-Identifier: BSD-3-Clause
 *   Copyright (c) Intel Corporation.
 *   All rights reserved.
 */

#ifndef FTL_DEBUG_H
#define FTL_DEBUG_H

#include "ftl_internal.h"
#include "ftl_core.h"

void ftl_dev_dump_stats(const struct spdk_ftl_dev *dev);

#endif /* FTL_DEBUG_H */
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
#include "spdk/config.h"

#include "ftl_core.h"
#include "ftl_debug.h"
#include "ftl_utils.h"
#include "mngt/ftl_mngt.h"

Loading