mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 01:54:44 +00:00
tools:acrn-crashlog: check blocks size instead of file size
What acrnprobe really care about is the storage capacity taken up from emmc. This patch checks all the logs' blocks size instead of the file size before collecting new logs. Tracked-On: #1024 Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com> Reviewed-by: Liu, Xiaojing <xiaojing.liu@intel.com> Acked-by: Chen, Gang <gang.c.chen@intel.com>
This commit is contained in:
committed by
ACRN System Integration
parent
fa1216325b
commit
13d50c2296
@@ -75,6 +75,19 @@ static inline ssize_t get_file_size(const char *filepath)
|
||||
return info.st_size;
|
||||
}
|
||||
|
||||
static inline ssize_t get_file_blocks_size(const char *filepath)
|
||||
{
|
||||
struct stat info;
|
||||
|
||||
if (filepath == NULL)
|
||||
return -ENOENT;
|
||||
|
||||
if (stat(filepath, &info) < 0)
|
||||
return -errno;
|
||||
|
||||
return info.st_blocks * 512;
|
||||
}
|
||||
|
||||
char *mm_get_line(struct mm_file_t *mfile, int line);
|
||||
int mkdir_p(const char *path);
|
||||
int remove_r(const char *dir);
|
||||
@@ -114,7 +127,7 @@ int dir_contains(const char *dir, const char *filename, size_t flen, int exact);
|
||||
int lsdir(const char *dir, char *fullname[], int limit);
|
||||
int find_file(const char *dir, size_t dlen, const char *target_file,
|
||||
size_t tflen, int depth, char *path[], int limit);
|
||||
int dir_size(const char *dir, size_t dlen, size_t *size);
|
||||
int dir_blocks_size(const char *dir, size_t dlen, size_t *size);
|
||||
int read_file(const char *path, unsigned long *size, void **data);
|
||||
int is_ac_filefmt(const char *file_fmt);
|
||||
int config_fmt_to_files(const char *file_fmt, char ***out);
|
||||
|
||||
Reference in New Issue
Block a user