Expand dump-functions for excluding user/unused memory (This is rebase commit for merging to development)
This commit is contained in:
committed by
Ken Sato
parent
325082a571
commit
a05b6e1ba8
3
test/dump/config
Executable file
3
test/dump/config
Executable file
@@ -0,0 +1,3 @@
|
||||
MCMOD_DIR=$HOME/ppos
|
||||
|
||||
export MCMOD_DIR
|
||||
321
test/dump/destroy_mem.patch
Normal file
321
test/dump/destroy_mem.patch
Normal file
@@ -0,0 +1,321 @@
|
||||
diff --git a/arch/x86/kernel/include/syscall_list.h b/arch/x86/kernel/include/syscall_list.h
|
||||
index 7c6edcb..f7f709b 100644
|
||||
--- a/arch/x86/kernel/include/syscall_list.h
|
||||
+++ b/arch/x86/kernel/include/syscall_list.h
|
||||
@@ -161,6 +161,9 @@ SYSCALL_HANDLED(__NR_profile, profile)
|
||||
SYSCALL_HANDLED(730, util_migrate_inter_kernel)
|
||||
SYSCALL_HANDLED(731, util_indicate_clone)
|
||||
SYSCALL_HANDLED(732, get_system)
|
||||
+/* McKernel Specific */
|
||||
+SYSCALL_HANDLED(901, usedmem_destroy)
|
||||
+SYSCALL_HANDLED(902, freemem_destroy)
|
||||
|
||||
/* McKernel Specific */
|
||||
SYSCALL_HANDLED(801, swapout)
|
||||
diff --git a/arch/x86/kernel/memory.c b/arch/x86/kernel/memory.c
|
||||
index 293daff..d7f17b9 100644
|
||||
--- a/arch/x86/kernel/memory.c
|
||||
+++ b/arch/x86/kernel/memory.c
|
||||
@@ -36,6 +36,8 @@
|
||||
#define ekprintf(...) do { kprintf(__VA_ARGS__); } while (0)
|
||||
#endif
|
||||
|
||||
+#define MEM_DESTROY_VAL 0xffffffffffffffff
|
||||
+
|
||||
static char *last_page;
|
||||
extern char _head[], _end[];
|
||||
|
||||
@@ -1364,6 +1366,119 @@ int visit_pte_range_safe(page_table_t pt, void *start0, void *end0, int pgshift,
|
||||
return walk_pte_l4_safe(pt, 0, start, end, &visit_pte_l4_safe, &args);
|
||||
}
|
||||
|
||||
+static int visit_pte_l1_dest(void *arg0, pte_t *ptep, uintptr_t base,
|
||||
+ uintptr_t start, uintptr_t end)
|
||||
+{
|
||||
+ if (*ptep == PTE_NULL) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ *ptep = MEM_DESTROY_VAL;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int visit_pte_l2_dest(void *arg0, pte_t *ptep, uintptr_t base,
|
||||
+ uintptr_t start, uintptr_t end)
|
||||
+{
|
||||
+ int error = 0;
|
||||
+ struct visit_pte_args *args = arg0;
|
||||
+ struct page_table *pt;
|
||||
+
|
||||
+ if (*ptep == PTE_NULL) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if ((*ptep & PFL2_SIZE)
|
||||
+ && (start <= base)
|
||||
+ && (((base + PTL2_SIZE) <= end)
|
||||
+ || (end == 0))
|
||||
+ && (!args->pgshift || (args->pgshift == PTL2_SHIFT))) {
|
||||
+
|
||||
+ *ptep = MEM_DESTROY_VAL;
|
||||
+ return error;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ if (*ptep & PFL2_SIZE) {
|
||||
+ ekprintf("visit_pte_l2:split large page\n");
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ pt = phys_to_virt(*ptep & PT_PHYSMASK);
|
||||
+
|
||||
+ error = walk_pte_l1_safe(pt, base, start, end, &visit_pte_l1_dest, arg0);
|
||||
+ return error;
|
||||
+}
|
||||
+
|
||||
+static int visit_pte_l3_dest(void *arg0, pte_t *ptep, uintptr_t base,
|
||||
+ uintptr_t start, uintptr_t end)
|
||||
+{
|
||||
+ int error = 0;
|
||||
+ struct visit_pte_args *args = arg0;
|
||||
+ struct page_table *pt;
|
||||
+
|
||||
+ if (*ptep == PTE_NULL) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if ((*ptep & PFL3_SIZE)
|
||||
+ && (start <= base)
|
||||
+ && (((base + PTL3_SIZE) <= end)
|
||||
+ || (end == 0))
|
||||
+ && (!args->pgshift || (args->pgshift == PTL3_SHIFT))
|
||||
+ && use_1gb_page) {
|
||||
+
|
||||
+ *ptep =MEM_DESTROY_VAL;
|
||||
+ return error;
|
||||
+ }
|
||||
+
|
||||
+ if (*ptep & PFL3_SIZE) {
|
||||
+ ekprintf("visit_pte_l3:split large page\n");
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ pt = phys_to_virt(*ptep & PT_PHYSMASK);
|
||||
+
|
||||
+ error = walk_pte_l2_safe(pt, base, start, end, &visit_pte_l2_dest, arg0);
|
||||
+ return error;
|
||||
+}
|
||||
+
|
||||
+static int visit_pte_l4_dest(void *arg0, pte_t *ptep, uintptr_t base,
|
||||
+ uintptr_t start, uintptr_t end)
|
||||
+{
|
||||
+ int error;
|
||||
+ struct page_table *pt;
|
||||
+
|
||||
+ kprintf("%s:Start.\n", __FUNCTION__);
|
||||
+
|
||||
+ if (*ptep == PTE_NULL) {
|
||||
+ kprintf("%s:End.\n", __FUNCTION__);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ pt = phys_to_virt(*ptep & PT_PHYSMASK);
|
||||
+
|
||||
+ error = walk_pte_l3_safe(pt, base, start, end, &visit_pte_l3_dest, arg0);
|
||||
+ kprintf("%s:End.\n", __FUNCTION__);
|
||||
+ return error;
|
||||
+}
|
||||
+
|
||||
+int visit_pte_range_dest(page_table_t pt, void *start0, void *end0, int pgshift,
|
||||
+ enum visit_pte_flag flags, pte_visitor_t *funcp, void *arg)
|
||||
+{
|
||||
+ const uintptr_t start = (uintptr_t)start0;
|
||||
+ const uintptr_t end = (uintptr_t)end0;
|
||||
+ struct visit_pte_args args;
|
||||
+
|
||||
+ args.pt = pt;
|
||||
+ args.flags = flags;
|
||||
+ args.funcp = funcp;
|
||||
+ args.arg = arg;
|
||||
+ args.pgshift = pgshift;
|
||||
+
|
||||
+ return walk_pte_l4_safe(pt, 0, start, end, &visit_pte_l4_dest, &args);
|
||||
+}
|
||||
+
|
||||
struct clear_range_args {
|
||||
int free_physical;
|
||||
struct memobj *memobj;
|
||||
diff --git a/kernel/include/rbtree.h b/kernel/include/rbtree.h
|
||||
index 990f0d7..24d71c2 100644
|
||||
--- a/kernel/include/rbtree.h
|
||||
+++ b/kernel/include/rbtree.h
|
||||
@@ -66,6 +66,7 @@ extern void rb_erase(struct rb_node *, struct rb_root *);
|
||||
/* Find logical next and previous nodes in a tree */
|
||||
extern struct rb_node *rb_next(const struct rb_node *);
|
||||
extern struct rb_node *rb_next_safe(const struct rb_node *);
|
||||
+extern struct rb_node *rb_next_dest(const struct rb_node *);
|
||||
extern struct rb_node *rb_prev(const struct rb_node *);
|
||||
extern struct rb_node *rb_first(const struct rb_root *);
|
||||
extern struct rb_node *rb_first_safe(const struct rb_root *);
|
||||
diff --git a/kernel/mem.c b/kernel/mem.c
|
||||
index 8fe450d..e8e05bd 100644
|
||||
--- a/kernel/mem.c
|
||||
+++ b/kernel/mem.c
|
||||
@@ -2482,3 +2482,28 @@ int ihk_mc_get_mem_user_page(void *arg0, page_table_t pt, pte_t *ptep, void *pga
|
||||
|
||||
return 0;
|
||||
}
|
||||
+
|
||||
+void ihk_mc_mem_free_page_dest(void) {
|
||||
+ struct rb_node *node;
|
||||
+ struct rb_root *free_chunks;
|
||||
+ unsigned long free_pages, free_page_cnt;
|
||||
+ int i;
|
||||
+
|
||||
+ /* Search all NUMA nodes */
|
||||
+ for (i = 0; i < ihk_mc_get_nr_numa_nodes(); i++) {
|
||||
+
|
||||
+ free_chunks = &memory_nodes[i].free_chunks;
|
||||
+ free_pages = memory_nodes[i].nr_free_pages;
|
||||
+
|
||||
+ /* rb-tree search */
|
||||
+ for (free_page_cnt = 0, node = rb_first(free_chunks); node; free_page_cnt++, node = rb_next_dest(node)) {
|
||||
+
|
||||
+ if (free_page_cnt >= free_pages)
|
||||
+ break;
|
||||
+
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
diff --git a/kernel/rbtree.c b/kernel/rbtree.c
|
||||
index 5134a0d..2a0383f 100644
|
||||
--- a/kernel/rbtree.c
|
||||
+++ b/kernel/rbtree.c
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
#define EXPORT_SYMBOL(x)
|
||||
|
||||
+#define MEM_DESTROY_VAL 0xffffffffffffffff
|
||||
+
|
||||
extern int ihk_mc_chk_page_address(unsigned long mem_addr);
|
||||
extern unsigned long virt_to_phys(void *v);
|
||||
|
||||
@@ -555,6 +557,47 @@ struct rb_node *rb_next_safe(const struct rb_node *node)
|
||||
}
|
||||
EXPORT_SYMBOL(rb_next_safe);
|
||||
|
||||
+struct rb_node *rb_next_dest(const struct rb_node *node)
|
||||
+{
|
||||
+ struct rb_node *parent;
|
||||
+ struct rb_node *node_tmp = NULL;
|
||||
+
|
||||
+ if (RB_EMPTY_NODE(node))
|
||||
+ return NULL;
|
||||
+
|
||||
+ /*
|
||||
+ * * If we have a right-hand child, go down and then left as far
|
||||
+ * * as we can.
|
||||
+ * */
|
||||
+ if (node->rb_right) {
|
||||
+ node = node->rb_right;
|
||||
+
|
||||
+ while (node->rb_left) {
|
||||
+ node_tmp = (struct rb_node *)node;
|
||||
+ node=node->rb_left;
|
||||
+ }
|
||||
+
|
||||
+ if(node_tmp != NULL) {
|
||||
+ node_tmp->rb_left = (struct rb_node *)MEM_DESTROY_VAL;
|
||||
+ }
|
||||
+
|
||||
+ return (struct rb_node *)node;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * * No right-hand children. Everything down and left is smaller than us,
|
||||
+ * * so any 'next' node must be in the general direction of our parent.
|
||||
+ * * Go up the tree; any time the ancestor is a right-hand child of its
|
||||
+ * * parent, keep going up. First time it's a left-hand child of its
|
||||
+ * * parent, said parent is our 'next' node.
|
||||
+ * */
|
||||
+ while ((parent = rb_parent(node)) && node == parent->rb_right)
|
||||
+ node = parent;
|
||||
+
|
||||
+ return parent;
|
||||
+}
|
||||
+EXPORT_SYMBOL(rb_next_dest);
|
||||
+
|
||||
struct rb_node *rb_prev(const struct rb_node *node)
|
||||
{
|
||||
struct rb_node *parent;
|
||||
diff --git a/kernel/syscall.c b/kernel/syscall.c
|
||||
index 6d23702..5620bf4 100644
|
||||
--- a/kernel/syscall.c
|
||||
+++ b/kernel/syscall.c
|
||||
@@ -9885,6 +9885,43 @@ set_cputime(int mode)
|
||||
}
|
||||
}
|
||||
|
||||
+SYSCALL_DECLARE(usedmem_destroy)
|
||||
+{
|
||||
+ kprintf("usedmem_destroy() call\n");
|
||||
+
|
||||
+ struct resource_set *rset = cpu_local_var(resource_set);
|
||||
+ struct process_hash *phash = rset->process_hash;
|
||||
+ struct process *p;
|
||||
+ struct process_vm *vm;
|
||||
+ int i;
|
||||
+
|
||||
+ for (i=0; i<HASH_SIZE; i++) {
|
||||
+
|
||||
+ list_for_each_entry(p, &phash->list[i], hash_list){
|
||||
+ vm = p->vm;
|
||||
+ if (vm) {
|
||||
+ if(vm->address_space->page_table) {
|
||||
+ visit_pte_range_dest(vm->address_space->page_table, 0,
|
||||
+ (void *)USER_END, 0, 0,
|
||||
+ (void *)NULL, (void *)NULL);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+SYSCALL_DECLARE(freemem_destroy)
|
||||
+{
|
||||
+ kprintf("freemem_destroy() call\n");
|
||||
+
|
||||
+ ihk_mc_mem_free_page_dest();
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
long syscall(int num, ihk_mc_user_context_t *ctx)
|
||||
{
|
||||
long l;
|
||||
diff --git a/lib/include/ihk/mm.h b/lib/include/ihk/mm.h
|
||||
index 5b2aa70..18a5408 100644
|
||||
--- a/lib/include/ihk/mm.h
|
||||
+++ b/lib/include/ihk/mm.h
|
||||
@@ -191,6 +191,8 @@ int visit_pte_range(page_table_t pt, void *start, void *end, int pgshift,
|
||||
enum visit_pte_flag flags, pte_visitor_t *funcp, void *arg);
|
||||
int visit_pte_range_safe(page_table_t pt, void *start, void *end, int pgshift,
|
||||
enum visit_pte_flag flags, pte_visitor_t *funcp, void *arg);
|
||||
+int visit_pte_range_dest(page_table_t pt, void *start, void *end, int pgshift,
|
||||
+ enum visit_pte_flag flags, pte_visitor_t *funcp, void *arg);
|
||||
int move_pte_range(page_table_t pt, struct process_vm *vm,
|
||||
void *src, void *dest, size_t size, struct vm_range *range);
|
||||
|
||||
@@ -250,5 +252,5 @@ void ihk_mc_query_mem_user_page(void *dump_page_set);
|
||||
void ihk_mc_query_mem_free_page(void *dump_page_set);
|
||||
int ihk_mc_chk_page_address(pte_t mem_addr);
|
||||
int ihk_mc_get_mem_user_page(void *arg0, page_table_t pt, pte_t *ptep, void *pgaddr, int pgshift);
|
||||
-
|
||||
+void ihk_mc_mem_free_page_dest(void);
|
||||
#endif
|
||||
0
test/dump/dumps/.gitignore
vendored
Normal file
0
test/dump/dumps/.gitignore
vendored
Normal file
64
test/dump/go_linux_dump_test.sh
Executable file
64
test/dump/go_linux_dump_test.sh
Executable file
@@ -0,0 +1,64 @@
|
||||
#!/bin/sh
|
||||
|
||||
source ./config
|
||||
|
||||
FORCE_STOP=${HOME}/tmp/force_stop_linux_dump
|
||||
if [ -e ${FORCE_STOP} ]; then
|
||||
echo "force stopped Linux dump test "
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PANIC_LIST="./panic_list"
|
||||
PROGRESS_FILE="${HOME}/progress_linux_dump_test.txt"
|
||||
|
||||
if [ ! -f ${PANIC_LIST} ]; then
|
||||
cp ${PANIC_LIST}.in ${PANIC_LIST}
|
||||
fi
|
||||
|
||||
# check existing of done_panic
|
||||
if [ -e ./done_panic ]; then
|
||||
# test of ldump2mcdump
|
||||
|
||||
source ./done_panic
|
||||
|
||||
# find latest vmcore file
|
||||
latest_vmcore_dir="/var/crash/`ls -1t /var/crash | head -1`"
|
||||
latest_vmcore="${latest_vmcore_dir}/vmcore"
|
||||
|
||||
if [ ! -e ${latest_vmcore} ]; then
|
||||
echo "Error: latest vmcore is not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for case_name in ${BELOW_CASES}
|
||||
do
|
||||
param_file=./linux_testcases/${case_name}.txt
|
||||
mkdir -p "./result/linux_dump"
|
||||
logfile="./result/linux_dump/${case_name}.log"
|
||||
|
||||
./linux_dump_test.sh ${latest_vmcore} ${param_file} &> ${logfile}
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "[OK] ${case_name} is done." >> ${PROGRESS_FILE}
|
||||
else
|
||||
echo "[NG] failed to test ${case_name}, Please check ${logfile}" >> ${PROGRESS_FILE}
|
||||
fi
|
||||
done
|
||||
|
||||
rm ./done_panic
|
||||
# remove vmcore
|
||||
sudo rm -r ${latest_vmcore_dir}
|
||||
|
||||
# remove dump_file
|
||||
sudo rm ./mcdump &> /dev/null
|
||||
sudo rm ./dumps/mcdump_* &> /dev/null
|
||||
fi
|
||||
|
||||
# occur test panic
|
||||
panic_param=`head -1 ./panic_list`
|
||||
if [ "X${panic_param}" = "X" ]; then
|
||||
echo "All panic is done"
|
||||
exit 0
|
||||
fi
|
||||
sed -i -e "/`basename ${panic_param}`/d" ./panic_list
|
||||
./linux_dump_panic.sh ${panic_param}
|
||||
|
||||
25
test/dump/go_mck_dump_test.sh
Executable file
25
test/dump/go_mck_dump_test.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
for test_case in `ls -1 ./mck_testcases/*.txt`
|
||||
do
|
||||
case_name=`basename ${test_case} .txt`
|
||||
|
||||
mkdir -p "./result/mck_dump"
|
||||
|
||||
logfile="./result/mck_dump/${case_name}.log"
|
||||
./mck_dump_test.sh ${test_case} &> ${logfile}
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "[OK] ${case_name} is done."
|
||||
else
|
||||
echo "[NG] failed to test ${case_name}. Please check ${logfile}"
|
||||
fi
|
||||
|
||||
# save dump_file
|
||||
#sudo mv mcdump_* ./result/${case_name}/ &> /dev/null
|
||||
#sudo mv dumps/dumpfile_* ./result/${case_name}/ &> /dev/null
|
||||
|
||||
# remove dump_file
|
||||
sudo rm ./mcdump_* &> /dev/null
|
||||
sudo rm ./dumps/dumpfile_* &> /dev/null
|
||||
done
|
||||
25
test/dump/go_mck_dump_test_ofp.sh
Executable file
25
test/dump/go_mck_dump_test_ofp.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
for test_case in `ls -1 ./mck_testcases_ofp/*.txt`
|
||||
do
|
||||
case_name=`basename ${test_case} .txt`
|
||||
|
||||
mkdir -p "./result/mck_dump"
|
||||
|
||||
logfile="./result/mck_dump/${case_name}.log"
|
||||
./mck_dump_test.sh ${test_case} &> ${logfile}
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "[OK] ${case_name} is done."
|
||||
else
|
||||
echo "[NG] failed to test ${case_name}. Please check ${logfile}"
|
||||
fi
|
||||
|
||||
# save dump_file
|
||||
#sudo mv mcdump_* ./result/${case_name}/ &> /dev/null
|
||||
#sudo mv dumps/dumpfile_* ./result/${case_name}/ &> /dev/null
|
||||
|
||||
# remove dump_file
|
||||
sudo rm ./mcdump_* &> /dev/null
|
||||
sudo rm ./dumps/dumpfile_* &> /dev/null
|
||||
done
|
||||
51
test/dump/linux_dump_panic.sh
Executable file
51
test/dump/linux_dump_panic.sh
Executable file
@@ -0,0 +1,51 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Error: too few arguments."
|
||||
echo "usage: `basename $0` <param_file>"
|
||||
fi
|
||||
|
||||
# read config
|
||||
source ./config
|
||||
|
||||
# read testcase param
|
||||
source $1
|
||||
|
||||
echo `grep "BELOW_CASES" $1` > ./done_panic
|
||||
|
||||
# mcexec processのkill
|
||||
./utils/kill_mcexec.sh &> /dev/null
|
||||
|
||||
# stop mckernel
|
||||
#echo "${MCMOD_DIR}/sbin/mcstop+release.sh"
|
||||
sudo ${MCMOD_DIR}/sbin/mcstop+release.sh
|
||||
|
||||
# boot mckernel
|
||||
#echo "${MCMOD_DIR}/sbin/mcreboot.sh ${MCRBT_OPT%,}"
|
||||
sudo ${MCMOD_DIR}/sbin/mcreboot.sh ${MCRBT_OPT%,} ${DUMP_OPT}
|
||||
|
||||
sleep 1
|
||||
|
||||
if [ ! -e "/dev/mcos0" ]; then
|
||||
echo "Error: failed to mcreboot"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# exec mckernel test program
|
||||
for mc_proc in ${USR_PROC}
|
||||
do
|
||||
echo "${MCMOD_DIR}/bin/mcexec ${mc_proc}"
|
||||
${MCMOD_DIR}/bin/mcexec ${mc_proc} &
|
||||
done
|
||||
|
||||
# wait mmap
|
||||
sleep 10
|
||||
|
||||
echo `grep "BELOW_CASES" $1` > ./done_panic
|
||||
sleep 1
|
||||
|
||||
# do panic
|
||||
sudo sh -c "echo 1 > /proc/sys/kernel/sysrq"
|
||||
sudo sh -c "echo c > /proc/sysrq-trigger"
|
||||
|
||||
exit 0
|
||||
41
test/dump/linux_dump_test.sh
Executable file
41
test/dump/linux_dump_test.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "Error: too few arguments"
|
||||
echo "usage: `basename $0` <vmcore> <test_param_file>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# read test_param_file
|
||||
source $2
|
||||
|
||||
VMCORE=$1
|
||||
|
||||
sudo sh -c "env MCMOD_DIR=${MCMOD_DIR} ./utils/extract_mckdump.sh ${VMCORE} ${OUTFILE}"
|
||||
sleep 1
|
||||
|
||||
if [ "X${OUTFILE}" = "X" ]; then
|
||||
out_mckdump="./mcdump"
|
||||
else
|
||||
out_mckdump="${OUTFILE}"
|
||||
fi
|
||||
|
||||
if [ "X${ERROR_CASE}" = "X" ]; then
|
||||
# Normal case
|
||||
if [ ! -f ${out_mckdump} ]; then
|
||||
echo "Error: ${out_mckdump} is not created."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# show dump_file info
|
||||
./utils/show_mckdump.sh ${out_mckdump}
|
||||
|
||||
else
|
||||
# Error case
|
||||
if [ -f ${out_mckdump} ]; then
|
||||
echo "Error: ${out_mckdump} is created."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
1
test/dump/linux_testcases/0001_linux.txt
Normal file
1
test/dump/linux_testcases/0001_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0001.dmp"
|
||||
1
test/dump/linux_testcases/0002_linux.txt
Normal file
1
test/dump/linux_testcases/0002_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0003_linux.txt
Normal file
1
test/dump/linux_testcases/0003_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0003.dmp"
|
||||
1
test/dump/linux_testcases/0004_linux.txt
Normal file
1
test/dump/linux_testcases/0004_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0005_linux.txt
Normal file
1
test/dump/linux_testcases/0005_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0005.dmp"
|
||||
1
test/dump/linux_testcases/0006_linux.txt
Normal file
1
test/dump/linux_testcases/0006_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0007_linux.txt
Normal file
1
test/dump/linux_testcases/0007_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0007.dmp"
|
||||
1
test/dump/linux_testcases/0008_linux.txt
Normal file
1
test/dump/linux_testcases/0008_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0009_linux.txt
Normal file
1
test/dump/linux_testcases/0009_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0009.dmp"
|
||||
1
test/dump/linux_testcases/0010_linux.txt
Normal file
1
test/dump/linux_testcases/0010_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0011_linux.txt
Normal file
1
test/dump/linux_testcases/0011_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0011.dmp"
|
||||
1
test/dump/linux_testcases/0012_linux.txt
Normal file
1
test/dump/linux_testcases/0012_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0013_linux.txt
Normal file
1
test/dump/linux_testcases/0013_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0013.dmp"
|
||||
1
test/dump/linux_testcases/0014_linux.txt
Normal file
1
test/dump/linux_testcases/0014_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0015_linux.txt
Normal file
1
test/dump/linux_testcases/0015_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0015.dmp"
|
||||
1
test/dump/linux_testcases/0016_linux.txt
Normal file
1
test/dump/linux_testcases/0016_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0017_linux.txt
Normal file
1
test/dump/linux_testcases/0017_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0017.dmp"
|
||||
1
test/dump/linux_testcases/0018_linux.txt
Normal file
1
test/dump/linux_testcases/0018_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0019_linux.txt
Normal file
1
test/dump/linux_testcases/0019_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0019.dmp"
|
||||
1
test/dump/linux_testcases/0020_linux.txt
Normal file
1
test/dump/linux_testcases/0020_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0021_linux.txt
Normal file
1
test/dump/linux_testcases/0021_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0021.dmp"
|
||||
1
test/dump/linux_testcases/0022_linux.txt
Normal file
1
test/dump/linux_testcases/0022_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0023_linux.txt
Normal file
1
test/dump/linux_testcases/0023_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0023.dmp"
|
||||
1
test/dump/linux_testcases/0024_linux.txt
Normal file
1
test/dump/linux_testcases/0024_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0025_linux.txt
Normal file
1
test/dump/linux_testcases/0025_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0025.dmp"
|
||||
1
test/dump/linux_testcases/0026_linux.txt
Normal file
1
test/dump/linux_testcases/0026_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0027_linux.txt
Normal file
1
test/dump/linux_testcases/0027_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0027.dmp"
|
||||
1
test/dump/linux_testcases/0028_linux.txt
Normal file
1
test/dump/linux_testcases/0028_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0029_linux.txt
Normal file
1
test/dump/linux_testcases/0029_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0029.dmp"
|
||||
1
test/dump/linux_testcases/0030_linux.txt
Normal file
1
test/dump/linux_testcases/0030_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0031_linux.txt
Normal file
1
test/dump/linux_testcases/0031_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0031.dmp"
|
||||
1
test/dump/linux_testcases/0032_linux.txt
Normal file
1
test/dump/linux_testcases/0032_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0033_linux.txt
Normal file
1
test/dump/linux_testcases/0033_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0033.dmp"
|
||||
1
test/dump/linux_testcases/0034_linux.txt
Normal file
1
test/dump/linux_testcases/0034_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0035_linux.txt
Normal file
1
test/dump/linux_testcases/0035_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0035.dmp"
|
||||
1
test/dump/linux_testcases/0036_linux.txt
Normal file
1
test/dump/linux_testcases/0036_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0037_linux.txt
Normal file
1
test/dump/linux_testcases/0037_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0037.dmp"
|
||||
1
test/dump/linux_testcases/0038_linux.txt
Normal file
1
test/dump/linux_testcases/0038_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0039_linux.txt
Normal file
1
test/dump/linux_testcases/0039_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0039.dmp"
|
||||
1
test/dump/linux_testcases/0040_linux.txt
Normal file
1
test/dump/linux_testcases/0040_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0041_linux.txt
Normal file
1
test/dump/linux_testcases/0041_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0041.dmp"
|
||||
1
test/dump/linux_testcases/0042_linux.txt
Normal file
1
test/dump/linux_testcases/0042_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0043_linux.txt
Normal file
1
test/dump/linux_testcases/0043_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0043.dmp"
|
||||
1
test/dump/linux_testcases/0044_linux.txt
Normal file
1
test/dump/linux_testcases/0044_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE=""
|
||||
1
test/dump/linux_testcases/0045_linux.txt
Normal file
1
test/dump/linux_testcases/0045_linux.txt
Normal file
@@ -0,0 +1 @@
|
||||
OUTFILE="./dumps/mcdump_0045.dmp"
|
||||
2
test/dump/linux_testcases/0046_linux.txt
Normal file
2
test/dump/linux_testcases/0046_linux.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
OUTFILE="./not_exist_dir/file"
|
||||
ERROR_CASE="yes"
|
||||
2
test/dump/linux_testcases/0047_linux.txt
Normal file
2
test/dump/linux_testcases/0047_linux.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
OUTFILE="${HOME}/testdump"
|
||||
ERROR_CASE="yes"
|
||||
4
test/dump/linux_testcases/panic_0001.txt
Normal file
4
test/dump/linux_testcases/panic_0001.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m 32M@0"
|
||||
DUMP_OPT=""
|
||||
USR_PROC="mcexec_test_proc/test_pt_1kb_1time"
|
||||
BELOW_CASES="0001_linux 0002_linux"
|
||||
4
test/dump/linux_testcases/panic_0002.txt
Normal file
4
test/dump/linux_testcases/panic_0002.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m 32M@0"
|
||||
DUMP_OPT="-d 0"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1mb_10times"
|
||||
BELOW_CASES="0003_linux 0004_linux"
|
||||
4
test/dump/linux_testcases/panic_0003.txt
Normal file
4
test/dump/linux_testcases/panic_0003.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m 2G@0"
|
||||
DUMP_OPT="-d 24"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1gb_1time"
|
||||
BELOW_CASES="0005_linux 0006_linux"
|
||||
4
test/dump/linux_testcases/panic_0004.txt
Normal file
4
test/dump/linux_testcases/panic_0004.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 20M 128`"
|
||||
DUMP_OPT=""
|
||||
USR_PROC="mcexec_test_proc/test_pt_1kb_1time"
|
||||
BELOW_CASES="0007_linux 0008_linux"
|
||||
4
test/dump/linux_testcases/panic_0005.txt
Normal file
4
test/dump/linux_testcases/panic_0005.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 20M 128`"
|
||||
DUMP_OPT="-d 0"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1mb_10times"
|
||||
BELOW_CASES="0009_linux 0010_linux"
|
||||
4
test/dump/linux_testcases/panic_0006.txt
Normal file
4
test/dump/linux_testcases/panic_0006.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 20M 128`"
|
||||
DUMP_OPT="-d 24"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1gb_1time"
|
||||
BELOW_CASES="0011_linux 0012_linux"
|
||||
4
test/dump/linux_testcases/panic_0007.txt
Normal file
4
test/dump/linux_testcases/panic_0007.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 20M 512`"
|
||||
DUMP_OPT=""
|
||||
USR_PROC="mcexec_test_proc/test_pt_1mb_10times"
|
||||
BELOW_CASES="0013_linux 0014_linux"
|
||||
4
test/dump/linux_testcases/panic_0008.txt
Normal file
4
test/dump/linux_testcases/panic_0008.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 20M 512`"
|
||||
DUMP_OPT="-d 0"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1gb_1time"
|
||||
BELOW_CASES="0015_linux 0016_linux"
|
||||
4
test/dump/linux_testcases/panic_0009.txt
Normal file
4
test/dump/linux_testcases/panic_0009.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 48M 512`"
|
||||
DUMP_OPT="-d 24"
|
||||
USR_PROC="mcexec_test_proc/test_pt_20mb_1000times"
|
||||
BELOW_CASES="0017_linux 0018_linux"
|
||||
4
test/dump/linux_testcases/panic_0010.txt
Normal file
4
test/dump/linux_testcases/panic_0010.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`"
|
||||
DUMP_OPT=""
|
||||
USR_PROC="mcexec_test_proc/test_pt_1kb_1time"
|
||||
BELOW_CASES="0019_linux 0020_linux"
|
||||
4
test/dump/linux_testcases/panic_0011.txt
Normal file
4
test/dump/linux_testcases/panic_0011.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`"
|
||||
DUMP_OPT="-d 0"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1mb_10times"
|
||||
BELOW_CASES="0021_linux 0022_linux"
|
||||
4
test/dump/linux_testcases/panic_0012.txt
Normal file
4
test/dump/linux_testcases/panic_0012.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 1G 1`"
|
||||
DUMP_OPT="-d 24"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1gb_1time"
|
||||
BELOW_CASES="0023_linux 0024_linux"
|
||||
4
test/dump/linux_testcases/panic_0013.txt
Normal file
4
test/dump/linux_testcases/panic_0013.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 20M 64`"
|
||||
DUMP_OPT=""
|
||||
USR_PROC="mcexec_test_proc/test_pt_1kb_1time"
|
||||
BELOW_CASES="0025_linux 0026_linux"
|
||||
4
test/dump/linux_testcases/panic_0014.txt
Normal file
4
test/dump/linux_testcases/panic_0014.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 20M 64`"
|
||||
DUMP_OPT="-d 0"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1mb_10times"
|
||||
BELOW_CASES="0027_linux 0028_linux"
|
||||
4
test/dump/linux_testcases/panic_0015.txt
Normal file
4
test/dump/linux_testcases/panic_0015.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 20M 64`"
|
||||
DUMP_OPT="-d 24"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1gb_1time"
|
||||
BELOW_CASES="0029_linux 0030_linux"
|
||||
4
test/dump/linux_testcases/panic_0016.txt
Normal file
4
test/dump/linux_testcases/panic_0016.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 20M 256`"
|
||||
DUMP_OPT=""
|
||||
USR_PROC="mcexec_test_proc/test_pt_1mb_10times"
|
||||
BELOW_CASES="0031_linux 0032_linux"
|
||||
4
test/dump/linux_testcases/panic_0017.txt
Normal file
4
test/dump/linux_testcases/panic_0017.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 20M 256`"
|
||||
DUMP_OPT="-d 0"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1gb_1time"
|
||||
BELOW_CASES="0033_linux 0034_linux"
|
||||
4
test/dump/linux_testcases/panic_0018.txt
Normal file
4
test/dump/linux_testcases/panic_0018.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 48M 256`"
|
||||
DUMP_OPT="-d 24"
|
||||
USR_PROC="mcexec_test_proc/test_pt_20mb_1000times"
|
||||
BELOW_CASES="0035_linux 0036_linux"
|
||||
4
test/dump/linux_testcases/panic_0019.txt
Normal file
4
test/dump/linux_testcases/panic_0019.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-c 4,12 -m `./utils/gen_mem_chunks.sh "0 1" 1G 1`"
|
||||
DUMP_OPT="-d 24"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1kb_1time mcexec_test_proc/test_pt_1gb_1time"
|
||||
BELOW_CASES="0037_linux 0038_linux"
|
||||
4
test/dump/linux_testcases/panic_0020.txt
Normal file
4
test/dump/linux_testcases/panic_0020.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-c 4,12 -m `./utils/gen_mem_chunks.sh "0 1" 32M 64`"
|
||||
DUMP_OPT="-d 24"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1kb_1time mcexec_test_proc/test_pt_1gb_1time"
|
||||
BELOW_CASES="0039_linux 0040_linux"
|
||||
4
test/dump/linux_testcases/panic_0021.txt
Normal file
4
test/dump/linux_testcases/panic_0021.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-c 4,12 -m `./utils/gen_mem_chunks.sh "0 1" 20M 256`"
|
||||
DUMP_OPT="-d 24"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1kb_1time mcexec_test_proc/test_pt_1gb_1time"
|
||||
BELOW_CASES="0041_linux 0042_linux"
|
||||
4
test/dump/linux_testcases/panic_0022.txt
Normal file
4
test/dump/linux_testcases/panic_0022.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m 32M@0"
|
||||
DUMP_OPT="-d 24"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1mb_10times mcexec_test_proc/memtest_used_destroy"
|
||||
BELOW_CASES="0043_linux"
|
||||
4
test/dump/linux_testcases/panic_0023.txt
Normal file
4
test/dump/linux_testcases/panic_0023.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m 32M@0"
|
||||
DUMP_OPT="-d 24"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1mb_10times mcexec_test_proc/memtest_free_destroy"
|
||||
BELOW_CASES="0044_linux 0045_linux 0046_linux 0047_linux"
|
||||
4
test/dump/linux_testcases/panic_0024.txt
Normal file
4
test/dump/linux_testcases/panic_0024.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
MCRBT_OPT="-m 32M@0"
|
||||
DUMP_OPT="-d 99"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1mb_10times"
|
||||
BELOW_CASES="0045_linux 0046_linux 0047_linux"
|
||||
6
test/dump/mcexec_test_proc/Makefile
Normal file
6
test/dump/mcexec_test_proc/Makefile
Normal file
@@ -0,0 +1,6 @@
|
||||
OBJS = test_pt_1gb_10times test_pt_1gb_1time test_pt_1kb_1time test_pt_1mb_10times test_pt_20mb_1000times memtest_free_destroy memtest_used_destroy
|
||||
|
||||
all: $(OBJS)
|
||||
|
||||
clean:
|
||||
rm $(OBJS)
|
||||
14
test/dump/mcexec_test_proc/memtest_free_destroy.c
Normal file
14
test/dump/mcexec_test_proc/memtest_free_destroy.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#define _GNU_SOURCE
|
||||
#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
main() {
|
||||
|
||||
int rst = 0;
|
||||
|
||||
rst = syscall(902);
|
||||
printf("freemem_destroy result:%d\n",rst);
|
||||
|
||||
return;
|
||||
}
|
||||
14
test/dump/mcexec_test_proc/memtest_used_destroy.c
Normal file
14
test/dump/mcexec_test_proc/memtest_used_destroy.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#define _GNU_SOURCE
|
||||
#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
main() {
|
||||
|
||||
int rst = 0;
|
||||
|
||||
rst = syscall(901);
|
||||
printf("usedmem_destroy result:%d\n",rst);
|
||||
|
||||
return;
|
||||
}
|
||||
30
test/dump/mcexec_test_proc/test_pt_1gb_10times.c
Normal file
30
test/dump/mcexec_test_proc/test_pt_1gb_10times.c
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#define MEM_SIZE (1024*1024*1024)
|
||||
#define LOOP_MAX 10
|
||||
#define SLEEP_TIME 30
|
||||
|
||||
main()
|
||||
{
|
||||
|
||||
int *buf,buf_size,index;
|
||||
|
||||
buf_size = MEM_SIZE;
|
||||
|
||||
for (index = 0; index < LOOP_MAX; index++) {
|
||||
buf = mmap(0, buf_size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
|
||||
if (NULL != buf) {
|
||||
memset(buf, 1, buf_size);
|
||||
} else {
|
||||
printf("[%d] mmap error!!! buf_size:%d(0x%x)\n", index, buf_size, buf_size);
|
||||
}
|
||||
}
|
||||
printf("mmap is done\n");
|
||||
|
||||
sleep(SLEEP_TIME);
|
||||
|
||||
return 0;
|
||||
}
|
||||
30
test/dump/mcexec_test_proc/test_pt_1gb_1time.c
Normal file
30
test/dump/mcexec_test_proc/test_pt_1gb_1time.c
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#define MEM_SIZE (1024*1024*1024)
|
||||
#define LOOP_MAX 1
|
||||
#define SLEEP_TIME 30
|
||||
|
||||
main()
|
||||
{
|
||||
|
||||
int *buf,buf_size,index;
|
||||
|
||||
buf_size = MEM_SIZE;
|
||||
|
||||
for (index = 0; index < LOOP_MAX; index++) {
|
||||
buf = mmap(0, buf_size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
|
||||
if (NULL != buf) {
|
||||
memset(buf, 1, buf_size);
|
||||
} else {
|
||||
printf("[%d] mmap error!!! buf_size:%d(0x%x)\n", index, buf_size, buf_size);
|
||||
}
|
||||
}
|
||||
printf("mmap is done\n");
|
||||
|
||||
sleep(SLEEP_TIME);
|
||||
|
||||
return 0;
|
||||
}
|
||||
30
test/dump/mcexec_test_proc/test_pt_1kb_1time.c
Normal file
30
test/dump/mcexec_test_proc/test_pt_1kb_1time.c
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#define MEM_SIZE (1024)
|
||||
#define LOOP_MAX 1
|
||||
#define SLEEP_TIME 30
|
||||
|
||||
main()
|
||||
{
|
||||
|
||||
int *buf,buf_size,index;
|
||||
|
||||
buf_size = MEM_SIZE;
|
||||
|
||||
for (index = 0; index < LOOP_MAX; index++) {
|
||||
buf = mmap(0, buf_size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
|
||||
if (NULL != buf) {
|
||||
memset(buf, 1, buf_size);
|
||||
} else {
|
||||
printf("[%d] mmap error!!! buf_size:%d(0x%x)\n", index, buf_size, buf_size);
|
||||
}
|
||||
}
|
||||
printf("mmap is done\n");
|
||||
|
||||
sleep(SLEEP_TIME);
|
||||
|
||||
return 0;
|
||||
}
|
||||
30
test/dump/mcexec_test_proc/test_pt_1mb_10times.c
Normal file
30
test/dump/mcexec_test_proc/test_pt_1mb_10times.c
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#define MEM_SIZE (1024*1024)
|
||||
#define LOOP_MAX 10
|
||||
#define SLEEP_TIME 30
|
||||
|
||||
main()
|
||||
{
|
||||
|
||||
int *buf,buf_size,index;
|
||||
|
||||
buf_size = MEM_SIZE;
|
||||
|
||||
for (index = 0; index < LOOP_MAX; index++) {
|
||||
buf = mmap(0, buf_size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
|
||||
if (NULL != buf) {
|
||||
memset(buf, 1, buf_size);
|
||||
} else {
|
||||
printf("[%d] mmap error!!! buf_size:%d(0x%x)\n", index, buf_size, buf_size);
|
||||
}
|
||||
}
|
||||
printf("mmap is done\n");
|
||||
|
||||
sleep(SLEEP_TIME);
|
||||
|
||||
return 0;
|
||||
}
|
||||
30
test/dump/mcexec_test_proc/test_pt_20mb_1000times.c
Normal file
30
test/dump/mcexec_test_proc/test_pt_20mb_1000times.c
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#define MEM_SIZE (1024*1024*20)
|
||||
#define LOOP_MAX 1024
|
||||
#define SLEEP_TIME 30
|
||||
|
||||
main()
|
||||
{
|
||||
|
||||
int *buf,buf_size,index;
|
||||
|
||||
buf_size = MEM_SIZE;
|
||||
|
||||
for (index = 0; index < LOOP_MAX; index++) {
|
||||
buf = mmap(0, buf_size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
|
||||
if (NULL != buf) {
|
||||
memset(buf, 1, buf_size);
|
||||
} else {
|
||||
printf("[%d] mmap error!!! buf_size:%d(0x%x)\n", index, buf_size, buf_size);
|
||||
}
|
||||
}
|
||||
printf("mmap is done\n");
|
||||
|
||||
sleep(SLEEP_TIME);
|
||||
|
||||
return 0;
|
||||
}
|
||||
100
test/dump/mck_dump_test.sh
Executable file
100
test/dump/mck_dump_test.sh
Executable file
@@ -0,0 +1,100 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Error: too few arguments."
|
||||
echo "usage: `basename $0` <param_file>"
|
||||
fi
|
||||
|
||||
# read config
|
||||
source ./config
|
||||
|
||||
# read testcase param
|
||||
source $1
|
||||
|
||||
# mcexec processのkill
|
||||
./utils/kill_mcexec.sh &> /dev/null
|
||||
|
||||
# stop mckernel
|
||||
sudo ${MCMOD_DIR}/sbin/mcstop+release.sh
|
||||
|
||||
# boot mckernel
|
||||
echo "${MCMOD_DIR}/sbin/mcreboot.sh ${MCRBT_OPT%,}"
|
||||
sudo ${MCMOD_DIR}/sbin/mcreboot.sh ${MCRBT_OPT%,}
|
||||
|
||||
sleep 1
|
||||
|
||||
if [ ! -e "/dev/mcos0" ]; then
|
||||
echo "Error: failed to mcreboot"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# exec mckernel test program
|
||||
for mc_proc in ${USR_PROC}
|
||||
do
|
||||
echo "${MCMOD_DIR}/bin/mcexec ${mc_proc}"
|
||||
${MCMOD_DIR}/bin/mcexec ${mc_proc} &
|
||||
done
|
||||
# wait mmap
|
||||
sleep 5
|
||||
|
||||
if [ "X${DUMP_FILE}" = "X" ]; then
|
||||
dump_cnt=`find ./ -maxdepth 1 -name "mcdump_*" | wc -l`
|
||||
fi
|
||||
|
||||
# do dump
|
||||
echo "${MCMOD_DIR}/sbin/ihkosctl ${OS_IDX} dump ${DUMP_OPT} ${DUMP_FILE}"
|
||||
SECONDS=0
|
||||
if [ "X${NO_SUDO}" = "X" ]; then
|
||||
sudo ${MCMOD_DIR}/sbin/ihkosctl ${OS_IDX} dump ${DUMP_OPT} ${DUMP_FILE}
|
||||
else
|
||||
${MCMOD_DIR}/sbin/ihkosctl ${OS_IDX} dump ${DUMP_OPT} ${DUMP_FILE}
|
||||
fi
|
||||
rc=$?
|
||||
|
||||
echo "Dump takes ${SECONDS} secs."
|
||||
|
||||
if [ "X${ERROR_CASE}" = "X" ]; then
|
||||
# Normal case
|
||||
if [ ${rc} -ne 0 ]; then
|
||||
echo "Error: dump returns not 0"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "X${DUMP_FILE}" = "X" ]; then
|
||||
if [ ${dump_cnt} -eq `find ./ -maxdepth 1 -name "mcdump_*" | wc -l` ]; then
|
||||
echo "Error: default dump_file is not created"
|
||||
echo "$dump_cnt `ls`"
|
||||
exit 1
|
||||
else
|
||||
out_dump_file=`ls -1 ./mcdump_*`
|
||||
fi
|
||||
else
|
||||
if [ ! -e ${DUMP_FILE} ]; then
|
||||
echo "Error: specified dump_file, ${DUMP_FILE} is not created"
|
||||
exit 1
|
||||
else
|
||||
out_dump_file=${DUMP_FILE}
|
||||
fi
|
||||
fi
|
||||
# show dump_file info
|
||||
./utils/show_mckdump.sh ${out_dump_file}
|
||||
else
|
||||
# Error case
|
||||
if [ ${rc} -eq 0 ]; then
|
||||
echo "dump return 0"
|
||||
exit 1
|
||||
fi
|
||||
if [ "X${DUMP_FILE}" = "X" ]; then
|
||||
if [ ${dump_cnt} -ne `find ./ -maxdepth 1 -name "mcdump_*" | wc -l` ]; then
|
||||
echo "Error: default dump_file is created"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
if [ -e ${DUMP_FILE} ]; then
|
||||
echo "Error: specified dump_file, ${DUMP_FILE} is created"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
5
test/dump/mck_testcases/0001_mckernel.txt
Normal file
5
test/dump/mck_testcases/0001_mckernel.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
MCRBT_OPT="-m 32M@0"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1kb_1time"
|
||||
OS_IDX=0
|
||||
DUMP_OPT=""
|
||||
DUMP_FILE=""
|
||||
5
test/dump/mck_testcases/0002_mckernel.txt
Normal file
5
test/dump/mck_testcases/0002_mckernel.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
MCRBT_OPT="-m 32M@0,32M@1"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1kb_1time"
|
||||
OS_IDX=0
|
||||
DUMP_OPT="-d 24"
|
||||
DUMP_FILE=""
|
||||
5
test/dump/mck_testcases/0003_mckernel.txt
Normal file
5
test/dump/mck_testcases/0003_mckernel.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1kb_1time"
|
||||
OS_IDX=0
|
||||
DUMP_OPT="-d 24"
|
||||
DUMP_FILE=""
|
||||
5
test/dump/mck_testcases/0004_mckernel.txt
Normal file
5
test/dump/mck_testcases/0004_mckernel.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1kb_1time"
|
||||
OS_IDX=0
|
||||
DUMP_OPT="-d 0"
|
||||
DUMP_FILE="./dumps/dumpfile_0004.log"
|
||||
5
test/dump/mck_testcases/0005_mckernel.txt
Normal file
5
test/dump/mck_testcases/0005_mckernel.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 20M 512`"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1kb_1time"
|
||||
OS_IDX=0
|
||||
DUMP_OPT="-d 0"
|
||||
DUMP_FILE="./dumps/dumpfile_0005.log"
|
||||
5
test/dump/mck_testcases/0006_mckernel.txt
Normal file
5
test/dump/mck_testcases/0006_mckernel.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 20M 256`"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1kb_1time"
|
||||
OS_IDX=0
|
||||
DUMP_OPT="-d 24"
|
||||
DUMP_FILE=""
|
||||
5
test/dump/mck_testcases/0007_mckernel.txt
Normal file
5
test/dump/mck_testcases/0007_mckernel.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
MCRBT_OPT="-m 32M@0"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1mb_10times"
|
||||
OS_IDX=0
|
||||
DUMP_OPT=""
|
||||
DUMP_FILE=""
|
||||
5
test/dump/mck_testcases/0008_mckernel.txt
Normal file
5
test/dump/mck_testcases/0008_mckernel.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
MCRBT_OPT="-m 32M@0,32M@1"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1mb_10times"
|
||||
OS_IDX=0
|
||||
DUMP_OPT="-d 24"
|
||||
DUMP_FILE=""
|
||||
5
test/dump/mck_testcases/0009_mckernel.txt
Normal file
5
test/dump/mck_testcases/0009_mckernel.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1mb_10times"
|
||||
OS_IDX=0
|
||||
DUMP_OPT="-d 24"
|
||||
DUMP_FILE=""
|
||||
5
test/dump/mck_testcases/0010_mckernel.txt
Normal file
5
test/dump/mck_testcases/0010_mckernel.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1mb_10times"
|
||||
OS_IDX=0
|
||||
DUMP_OPT="-d 0"
|
||||
DUMP_FILE="./dumps/dumpfile_0010.log"
|
||||
5
test/dump/mck_testcases/0011_mckernel.txt
Normal file
5
test/dump/mck_testcases/0011_mckernel.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 20M 512`"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1mb_10times"
|
||||
OS_IDX=0
|
||||
DUMP_OPT="-d 24"
|
||||
DUMP_FILE="./dumps/dumpfile_0011.log"
|
||||
5
test/dump/mck_testcases/0012_mckernel.txt
Normal file
5
test/dump/mck_testcases/0012_mckernel.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 20M 256`"
|
||||
USR_PROC="mcexec_test_proc/test_pt_1mb_10times"
|
||||
OS_IDX=0
|
||||
DUMP_OPT="-d 0"
|
||||
DUMP_FILE=""
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user