git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Architectural Support: x86_64 (#37)
[lunaix-os.git]
/
lunaix-os
/
kernel
/
debug
/
trace.c
diff --git
a/lunaix-os/kernel/debug/trace.c
b/lunaix-os/kernel/debug/trace.c
index 66e5505e2bc97a92d6c022beecbbe57391be9112..e238526717547c59461ec3e14af0aaefc232a4ed 100644
(file)
--- a/
lunaix-os/kernel/debug/trace.c
+++ b/
lunaix-os/kernel/debug/trace.c
@@
-71,14
+71,14
@@
static char*
ksym_getstr(struct ksym_entry* sym)
{
if (!sym) {
ksym_getstr(struct ksym_entry* sym)
{
if (!sym) {
- return
"???"
;
+ return
NULL
;
}
return sym->label;
}
static inline bool valid_fp(ptr_t ptr) {
}
return sym->label;
}
static inline bool valid_fp(ptr_t ptr) {
- ptr_t start = ROUNDUP(current_thread->kstack - KSTACK_SIZE,
MEM_PAG
E);
+ ptr_t start = ROUNDUP(current_thread->kstack - KSTACK_SIZE,
PAGE_SIZ
E);
return (start < ptr && ptr < current_thread->kstack)
|| arch_valid_fp(ptr);
return (start < ptr && ptr < current_thread->kstack)
|| arch_valid_fp(ptr);
@@
-121,10
+121,10
@@
trace_walkback(struct trace_record* tb_buffer,
static inline void
trace_print_code_entry(ptr_t sym_pc, ptr_t inst_pc, char* sym)
{
static inline void
trace_print_code_entry(ptr_t sym_pc, ptr_t inst_pc, char* sym)
{
- if (sym
_pc
) {
+ if (sym) {
trace_log("%s+%p", sym, inst_pc - sym_pc);
} else {
trace_log("%s+%p", sym, inst_pc - sym_pc);
} else {
- trace_log("
%s [%p]", sym, sym
_pc);
+ trace_log("
??? [%p]", inst
_pc);
}
}
}
}
@@
-161,7
+161,7
@@
static void
trace_printswctx(const struct hart_state* hstate, bool from_usr, bool to_usr)
{
trace_printswctx(const struct hart_state* hstate, bool from_usr, bool to_usr)
{
- struct ksym_entry* sym = trace_sym_lookup(h
state->execp->eip
);
+ struct ksym_entry* sym = trace_sym_lookup(h
art_pc(hstate)
);
trace_log("^^^^^ --- %s", to_usr ? "user" : "kernel");
trace_print_transistion_short(hstate);
trace_log("^^^^^ --- %s", to_usr ? "user" : "kernel");
trace_print_transistion_short(hstate);