mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-18 15:28:43 +00:00
tools: acrn-crashlog: framework of acrn-crashlog
This is the first patch of acrn-crashlog. This patch initializes the framework of acrn-crashlog: acrnprobe, common, data, and usercrash. And it initializes the Makefile for each part. Signed-off-by: Liu Xinwu <xinwu.liu@intel.com> Signed-off-by: CHEN Gang <gang.c.chen@intel.com> Reviewed-by: Zhang Yanmin <yanmin.zhang@intel.com> Reviewed-by: Liu Chuansheng <chuansheng.liu@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com> Acked-by: Eddie Dong <Eddie.dong@intel.com>
This commit is contained in:
33
tools/acrn-crashlog/usercrash/Makefile
Normal file
33
tools/acrn-crashlog/usercrash/Makefile
Normal file
@@ -0,0 +1,33 @@
|
||||
all: check_obj usercrash_s usercrash_c
|
||||
|
||||
LIBS = -levent -lpthread
|
||||
|
||||
usercrash_s: $(BUILDDIR)/usercrash/obj/server.o
|
||||
$(CC) -g $(CFLAGS) $(LIBS) $(INCLUDE) $^ -o $(BUILDDIR)/usercrash/bin/$@ -lsystemd
|
||||
|
||||
usercrash_c: $(BUILDDIR)/usercrash/obj/client.o
|
||||
$(CC) -g $(CFLAGS) $(INCLUDE) $^ -o $(BUILDDIR)/usercrash/bin/$@ -lsystemd
|
||||
|
||||
$(BUILDDIR)/usercrash/obj/%.o:%.c
|
||||
$(CC) $(CFLAGS) $(INCLUDE) -o $@ -c $<
|
||||
|
||||
check_obj:
|
||||
@if [ ! -d $(BUILDDIR)/usercrash/bin ]; then \
|
||||
mkdir -p $(BUILDDIR)/usercrash/bin ; \
|
||||
fi
|
||||
@if [ ! -d $(BUILDDIR)/usercrash/obj ]; then \
|
||||
mkdir -p $(BUILDDIR)/usercrash/obj ; \
|
||||
fi
|
||||
|
||||
.PHONY:clean
|
||||
clean:
|
||||
@echo "Clean objects and binaries"
|
||||
@if [ -d $(BUILDDIR)/usercrash/obj ]; then \
|
||||
find $(BUILDDIR)/usercrash/obj -name "*.o" -exec $(RM) {} \; 2>&1 || exit 0; \
|
||||
fi
|
||||
@if [ -d $(BUILDDIR)/usercrash/bin ]; then \
|
||||
$(RM) -r $(BUILDDIR)/usercrash/bin ; \
|
||||
fi
|
||||
@if [ -d $(BUILDDIR)/usercrash/obj ]; then \
|
||||
$(RM) -r $(BUILDDIR)/usercrash/obj ; \
|
||||
fi
|
22
tools/acrn-crashlog/usercrash/client.c
Normal file
22
tools/acrn-crashlog/usercrash/client.c
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) <2018> Intel Corporation
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/**
|
||||
* Usercrash works as C/S model: usercrash_c works as usercrash client to
|
||||
* collect crash logs and information once crash event occurs. For each time,
|
||||
* usercrash_c receives 3 params from core_dump and sends connect request event
|
||||
* to usercrash_s, then it receives file fd from server to fill crash info into
|
||||
* the file. After this work is done, it will notify server that dump work is
|
||||
* completed.
|
||||
*/
|
||||
|
||||
int main(void)
|
||||
{
|
||||
//TO BE DONE
|
||||
//This empty function is to satisfy the dependency of Makefile.
|
||||
//This is the entry of usercrash_c, the implementation will be
|
||||
//filled by following patches.
|
||||
return 0;
|
||||
}
|
22
tools/acrn-crashlog/usercrash/server.c
Normal file
22
tools/acrn-crashlog/usercrash/server.c
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) <2018> Intel Corporation
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/**
|
||||
* Usercrash works as C/S model: usercrash_s works as usercrash server, which
|
||||
* is to handle events from client in endless loop. Once server receives events
|
||||
* from client, it will create usercrash_0x file under /var/log/usercrashes/
|
||||
* and send file fd to client. Then server will wait for client filling the
|
||||
* event info completely to the crash file. After client's work has been done,
|
||||
* server will be responsiable to free the crash node and process other events.
|
||||
*/
|
||||
|
||||
int main(void)
|
||||
{
|
||||
//TO BE DONE
|
||||
//This empty function is to satisfy the dependency of Makefile.
|
||||
//This is the entry of usercrash_s, the implementation will be filled
|
||||
//by following patches.
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user