tools: acrntrace: save trace data file under current dir by default

Current implementation save trace data files on tmpfs by default, acrntrace
would use up all the physical mem, which can affect system functioning.
This commit changes default location for trace data file to current dir, and
removes the codes for space reservation, which is not necessary.

Signed-off-by: Yan, Like <like.yan@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Yan, Like
2018-07-20 15:24:00 +08:00
committed by lijinxia
parent 3abfdbab72
commit 3d6ff0e5f4
4 changed files with 10 additions and 42 deletions

View File

@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdbool.h>
#include "sbuf.h"
#include <errno.h>
static inline bool sbuf_is_empty(shared_buf_t *sbuf)
{
@@ -59,9 +60,9 @@ int sbuf_write(int fd, shared_buf_t *sbuf)
start = (void *)sbuf + SBUF_HEAD_SIZE + sbuf->head;
written = write(fd, start, sbuf->ele_size);
if ( written != sbuf->ele_size) {
printf("Failed to write. Expect written size %d, returned %d\n",
sbuf->ele_size, written);
if (written != sbuf->ele_size) {
printf("Failed to write: ret %d (ele_size %d), errno %d\n",
written, sbuf->ele_size, (written == -1) ? errno : 0);
return -1;
}