libs/core: make memory tracer work with c and r events, avoid string allocations...