77
erl_printf(fd, "<cp/header:%08X", obj);
119
erts_print(to, to_arg, "<cp/header:%0*lX",PTR_SIZE,obj);
81
123
switch (tag_val_def(obj)) {
125
erts_print(to, to_arg, "[]");
86
print_atom((int)atom_val(obj), fd);
128
erts_print(to, to_arg, "%T", obj);
89
erl_printf(fd, "%d", signed_val(obj));
131
erts_print(to, to_arg, "%ld", signed_val(obj));
93
135
nobj = big_val(obj);
94
136
if (!IN_HEAP(p, nobj)) {
95
erl_printf(fd, "#<bad big %X>#", obj);
137
erts_print(to, to_arg, "#<bad big %X>#", obj);
99
141
i = BIG_SIZE(nobj);
100
142
if (BIG_SIGN(nobj))
101
erl_printf(fd, "-#integer(%d) = {", i);
143
erts_print(to, to_arg, "-#integer(%d) = {", i);
103
erl_printf(fd, "#integer(%d) = {", i);
104
erl_printf(fd, "%d", BIG_DIGIT(nobj, 0));
145
erts_print(to, to_arg, "#integer(%d) = {", i);
146
erts_print(to, to_arg, "%d", BIG_DIGIT(nobj, 0));
105
147
for (k = 1; k < i; k++)
106
erl_printf(fd, ",%d", BIG_DIGIT(nobj, k));
148
erts_print(to, to_arg, ",%d", BIG_DIGIT(nobj, k));
149
erts_putc(to, to_arg, '}');
110
152
case EXTERNAL_REF_DEF: {
112
erl_printf(fd, "#Ref<%lu", ref_channel_no(obj));
154
erts_print(to, to_arg, "#Ref<%lu", ref_channel_no(obj));
113
155
ref_num = ref_numbers(obj);
114
156
for (i = ref_no_of_numbers(obj)-1; i >= 0; i--)
115
erl_printf(fd, ",%lu", ref_num[i]);
157
erts_print(to, to_arg, ",%lu", ref_num[i]);
158
erts_print(to, to_arg, ">");
120
162
case EXTERNAL_PID_DEF:
121
erl_printf(fd, "<%lu.%lu.%lu>",
163
erts_print(to, to_arg, "<%lu.%lu.%lu>",
122
164
pid_channel_no(obj),
124
166
pid_serial(obj));
127
169
case EXTERNAL_PORT_DEF:
128
erl_printf(fd, "#Port<%lu.%lu>",
170
erts_print(to, to_arg, "#Port<%lu.%lu>",
129
171
port_channel_no(obj),
130
172
port_number(obj));
175
erts_putc(to, to_arg, '[');
134
176
nobj = list_val(obj);
136
178
if (!IN_HEAP(p, nobj)) {
137
erl_printf(fd, "#<bad list %X>", obj);
179
erts_print(to, to_arg, "#<bad list %X>", obj);
140
if (pdisplay1(p, *nobj++, fd) != 0)
182
if (pdisplay1(to, to_arg, p, *nobj++) != 0)
142
184
if (is_not_list(*nobj))
186
erts_putc(to, to_arg, ',');
145
187
nobj = list_val(*nobj);
147
189
if (is_not_nil(*nobj)) {
149
if (pdisplay1(p, *nobj, fd) != 0)
190
erts_putc(to, to_arg, '|');
191
if (pdisplay1(to, to_arg, p, *nobj) != 0)
194
erts_putc(to, to_arg, ']');
155
197
nobj = tuple_val(obj); /* pointer to arity */
156
198
i = arityval(*nobj); /* arity */
199
erts_putc(to, to_arg, '{');
159
if (pdisplay1(p, *++nobj,fd) != 0) return(1);
160
if (i >= 1) erl_putc(',',fd);
201
if (pdisplay1(to, to_arg, p, *++nobj) != 0) return(1);
202
if (i >= 1) erts_putc(to, to_arg, ',');
204
erts_putc(to, to_arg, '}');
164
206
case FLOAT_DEF: {
166
208
GET_DOUBLE(obj, ff);
168
erl_printf(fd, "%e", ff.fd);
210
erts_print(to, to_arg, "%e", ff.fd);
170
erl_printf(fd, "%.20e", ff.fd);
212
erts_print(to, to_arg, "%.20e", ff.fd);
175
erl_printf(fd, "#Bin");
217
erts_print(to, to_arg, "#Bin");
178
erl_printf(fd, "unknown object %x", obj);
220
erts_print(to, to_arg, "unknown object %x", obj);
192
236
while(sp >= stop) {
193
erl_printf(COUT,"%08lx: ", (Eterm) sp);
237
erts_print(to, to_arg, "%0*lx: ", PTR_SIZE, (Eterm) sp);
194
238
if (is_catch(*sp)) {
195
erl_printf(COUT, "catch %d", (Uint)catch_pc(*sp));
239
erts_print(to, to_arg, "catch %d", (Uint)catch_pc(*sp));
197
paranoid_display(p, *sp, COUT);
241
paranoid_display(to, to_arg, p, *sp);
199
erl_putc('\r', COUT);
200
erl_putc('\n', COUT);
243
erts_putc(to, to_arg, '\n');
250
static int verify_eterm(Process *p,Eterm element);
251
static int verify_eterm(Process *p,Eterm element)
254
ErlHeapFragment* mbuf;
256
switch (primary_tag(element)) {
257
case TAG_PRIMARY_LIST: ptr = list_val(element); break;
258
case TAG_PRIMARY_BOXED: ptr = boxed_val(element); break;
259
default: /* Immediate or header/cp */ return 1;
266
for (mbuf = p->mbuf; mbuf; mbuf = mbuf->next) {
267
if (WITHIN(ptr, &mbuf->mem[0], &mbuf->mem[0] + mbuf->size)) {
282
void erts_check_stack(Process *p)
285
Eterm *stack_start = p->heap + p->heap_sz;
286
Eterm *stack_end = p->htop;
288
if (p->stop > stack_start)
290
"<%lu.%lu.%lu>: Stack underflow\n",
291
internal_pid_channel_no(p->id),
292
internal_pid_number(p->id),
293
internal_pid_serial(p->id));
295
if (p->stop < stack_end)
297
"<%lu.%lu.%lu>: Stack overflow\n",
298
internal_pid_channel_no(p->id),
299
internal_pid_number(p->id),
300
internal_pid_serial(p->id));
302
for (elemp = p->stop; elemp < stack_start; elemp++) {
305
ErlHeapFragment* mbuf;
306
switch (primary_tag(*elemp)) {
307
case TAG_PRIMARY_LIST: ptr = list_val(*elemp); break;
308
case TAG_PRIMARY_BOXED: ptr = boxed_val(*elemp); break;
309
default: /* Immediate or cp */ continue;
313
for (mbuf = p->mbuf; mbuf; mbuf = mbuf->next)
314
if (WITHIN(ptr, &mbuf->mem[0], &mbuf->mem[0] + mbuf->size)) {
322
"<%lu.%lu.%lu>: Wild stack pointer\n",
323
internal_pid_channel_no(p->id),
324
internal_pid_number(p->id),
325
internal_pid_serial(p->id));
330
#if defined(CHECK_FOR_HOLES)
331
static void check_memory(Eterm *start, Eterm *end);
333
void erts_check_for_holes(Process* p)
338
start = p->last_htop ? p->last_htop : HEAP_START(p);
339
check_memory(start, HEAP_TOP(p));
340
p->last_htop = HEAP_TOP(p);
342
for (hf = MBUF(p); hf != 0; hf = hf->next) {
343
#if !defined(HEAP_FRAG_ELIM_TEST)
344
if (ARITH_HEAP(p) - hf->mem < (unsigned long)hf->size) {
345
check_memory(hf->mem, ARITH_HEAP(p));
346
if (hf == p->last_mbuf) {
351
if (hf == p->last_mbuf) {
354
check_memory(hf->mem, hf->mem+hf->size);
355
#if !defined(HEAP_FRAG_ELIM_TEST)
359
p->last_mbuf = MBUF(p);
362
static void check_memory(Eterm *start, Eterm *end)
369
if (hval == ERTS_HOLE_MARKER) {
370
erts_fprintf(stderr,"%s, line %d: ERTS_HOLE_MARKER found at 0x%0*lx\n",
371
__FILE__, __LINE__,PTR_SIZE,(unsigned long)(pos-1));
372
print_untagged_memory(start,end); /* DEBUGSTUFF */
374
} else if (is_thing(hval)) {
375
pos += (thing_arityval(hval));
384
* erts_check_heap and erts_check_memory will run through the heap
385
* silently if everything is ok. If there are strange (untagged) data
386
* in the heap or wild pointers, the system will be halted with an
389
void erts_check_heap(Process *p)
391
ErlHeapFragment* bp = MBUF(p);
393
erts_check_memory(p,HEAP_START(p),HEAP_TOP(p));
394
if (OLD_HEAP(p) != NULL) {
395
erts_check_memory(p,OLD_HEAP(p),OLD_HTOP(p));
399
#if !defined(HEAP_FRAG_ELIM_TEST)
400
if ((ARITH_HEAP(p) >= bp->mem) &&
401
(ARITH_HEAP(p) < bp->mem + bp->size)) {
402
erts_check_memory(p,bp->mem,ARITH_HEAP(p));
405
erts_check_memory(p,bp->mem,bp->mem + bp->size);
406
#if !defined(HEAP_FRAG_ELIM_TEST)
413
void erts_check_memory(Process *p, Eterm *start, Eterm *end)
421
if (hval == ARITH_MARKER) {
422
erl_exit(1, "ARITH_MARKER in heap fragment @ 0x%0*lx!\n",
423
PTR_SIZE,(unsigned long)(pos - 1));
425
else if (hval == DEBUG_BAD_WORD) {
426
print_untagged_memory(start, end);
427
erl_exit(1, "Uninitialized HAlloc'ed memory found @ 0x%0*lx!\n",
428
PTR_SIZE,(unsigned long)(pos - 1));
433
pos += thing_arityval(hval);
437
if (verify_eterm(p,hval))
440
erl_exit(1, "Wild pointer found @ 0x%0*lx!\n",
441
PTR_SIZE,(unsigned long)(pos - 1));
445
void verify_process(Process *p)
447
#define VERIFY_AREA(name,ptr,sz) { \
449
while (n--) if(!verify_eterm(p,*(ptr+n))) \
450
erl_exit(1,"Wild pointer found in " name " of %T!\n",p->id); }
452
#define VERIFY_ETERM(name,eterm) { \
453
if(!verify_eterm(p,eterm)) \
454
erl_exit(1,"Wild pointer found in " name " of %T!\n",p->id); }
457
ErlMessage* mp = p->msg.first;
459
VERBOSE(DEBUG_MEMORY,("Verify process: %T...\n",p->id));
462
VERIFY_ETERM("message term",ERL_MESSAGE_TERM(mp));
463
VERIFY_ETERM("message token",ERL_MESSAGE_TOKEN(mp));
471
VERIFY_AREA("dictionary",p->dictionary->data, p->dictionary->used);
472
if (p->debug_dictionary)
473
VERIFY_AREA("debug dictionary",p->debug_dictionary->data,
474
p->debug_dictionary->used);
475
VERIFY_ETERM("seq trace token",p->seq_trace_token);
476
VERIFY_ETERM("group leader",p->group_leader);
477
VERIFY_ETERM("fvalue",p->fvalue);
478
VERIFY_ETERM("ftrace",p->ftrace);
481
VERIFY_AREA("rrma",p->rrma,p->nrr);
484
VERBOSE(DEBUG_MEMORY,("...done\n"));
490
void verify_everything()
494
Uint n = erts_num_active_procs;
496
#ifdef INCREMENTAL_FREE_SIZES_NEEDS_TO_BE_TAGGED_AS_HEADERS_WITH_ARITY
497
INC_Page *page = inc_used_mem;
500
for (i = 0; i < n; i++) {
501
verify_process(erts_active_procs[i]);
504
erts_check_memory(NULL,global_heap,global_htop);
506
#ifdef INCREMENTAL_FREE_SIZES_NEEDS_TO_BE_TAGGED_AS_HEADERS_WITH_ARITY
509
Eterm *end = page + INC_PAGE_SIZE;
510
Eterm *pos = page->start;
515
pos += thing_arityval(val);
517
verify_eterm(NULL,val);
526
* print_untagged_memory will print the contents of given memory area.
528
void print_untagged_memory(Eterm *pos, Eterm *end)
531
erts_printf("| %*s | Range: 0x%0*lx - 0x%0*lx%*s|\n",
533
PTR_SIZE,(unsigned long)pos,
534
PTR_SIZE,(unsigned long)(end - 1),2 * PTR_SIZE - 2,"");
535
erts_printf("| %-*s | %-*s |\n",PTR_SIZE+2,"Address",
536
4*PTR_SIZE+11,"Contents");
537
erts_printf("|-%s-|-%s-%s-%s-%s-|\n",dashes,dashes,dashes,dashes,dashes);
540
erts_printf("| 0x%0*lx | ", PTR_SIZE, (unsigned long)pos);
541
erts_printf("0x%0*lx ",PTR_SIZE,(unsigned long)*pos);
549
erts_printf("%*s",PTR_SIZE+3,"");
554
erts_printf("+-%s-+-%s-%s-%s-%s-+\n",dashes,dashes,dashes,dashes,dashes);
558
* print_tagged_memory will print contents of given memory area and
559
* display it as if it was tagged Erlang terms (which it hopefully
560
* is). This function knows about forwarding pointers to be able to
561
* print a heap during garbage collection. erts_printf("%T",val)
562
* do not know about forwarding pointers though, so it will still
563
* crash if they are encoutered...
565
void print_tagged_memory(Eterm *pos, Eterm *end)
567
erts_printf("+-%s-+-%s-+\n",dashes,dashes);
568
erts_printf("| 0x%0*lx - 0x%0*lx |\n",
569
PTR_SIZE,(unsigned long)pos,
570
PTR_SIZE,(unsigned long)(end - 1));
571
erts_printf("| %-*s | %-*s |\n",PTR_SIZE,"Address",PTR_SIZE,"Contents");
572
erts_printf("|-%s-|-%s-|\n",dashes,dashes);
575
erts_printf("| 0x%0*lx | 0x%0*lx | ",
576
PTR_SIZE,(unsigned long)pos, PTR_SIZE,(unsigned long)val);
578
if( is_arity_value(val) ) {
579
erts_printf("Arity(%lu)", arityval(val));
580
} else if( is_thing(val) ) {
581
unsigned int ari = thing_arityval(val);
582
erts_printf("Thing Arity(%u) Tag(%lu)", ari, thing_subtag(val));
584
erts_printf("\n| 0x%0*lx | 0x%0*lx | THING",
585
PTR_SIZE, (unsigned long)pos,
586
PTR_SIZE, (unsigned long)*pos);
591
switch (primary_tag(val)) {
592
case TAG_PRIMARY_BOXED:
593
if (!is_header(*boxed_val(val))) {
594
erts_printf("Moved -> 0x%0*lx\n",PTR_SIZE,
595
(unsigned long)*boxed_val(val));
600
case TAG_PRIMARY_LIST:
601
if (is_non_value(*list_val(val))) {
602
erts_printf("Moved -> 0x%0*lx\n",PTR_SIZE,
603
(unsigned long)*(list_val(val) + 1));
608
erts_printf("%.30T", val);
612
erts_printf("+-%s-+-%s-+\n",dashes,dashes);
616
void print_ma_info(void)
618
erts_printf("Message Area (start - top - end): "
619
"0x%0*lx - 0x%0*lx - 0x%0*lx\n",
620
PTR_SIZE, (unsigned long)global_heap,
621
PTR_SIZE, (unsigned long)global_htop,
622
PTR_SIZE, (unsigned long)global_hend);
624
erts_printf(" High water: 0x%0*lx "
625
"Old gen: 0x%0*lx - 0x%0*lx - 0x%0*lx\n",
626
PTR_SIZE, (unsigned long)global_high_water,
627
PTR_SIZE, (unsigned long)global_old_heap,
628
PTR_SIZE, (unsigned long)global_old_htop,
629
PTR_SIZE, (unsigned long)global_old_hend);
633
void print_message_area(void)
635
Eterm *pos = global_heap;
636
Eterm *end = global_htop;
638
erts_printf("From: 0x%0*lx to 0x%0*lx\n",
639
PTR_SIZE,(unsigned long)pos,PTR_SIZE,(unsigned long)end);
640
erts_printf("(Old generation: 0x%0*lx to 0x%0*lx\n",
641
PTR_SIZE, (unsigned long)global_old_heap,
642
PTR_SIZE, (unsigned long)global_old_hend);
643
erts_printf("| %-*s | %-*s |\n",PTR_SIZE,"Address",PTR_SIZE,"Contents");
644
erts_printf("|-%s-|-%s-|\n",dashes,dashes);
647
erts_printf("| 0x%0*lx | 0x%0*lx | ",
648
PTR_SIZE,(unsigned long)pos,PTR_SIZE,(unsigned long)val);
650
if( is_arity_value(val) ) {
651
erts_printf("Arity(%lu)", arityval(val));
652
} else if( is_thing(val) ) {
653
unsigned int ari = thing_arityval(val);
654
erts_printf("Thing Arity(%u) Tag(%lu)", ari, thing_subtag(val));
656
erts_printf("\n| 0x%0*lx | 0x%0*lx | THING",
657
PTR_SIZE, (unsigned long)pos,
658
PTR_SIZE, (unsigned long)*pos);
663
erts_printf("%.30T", val);
666
erts_printf("+-%s-+-%s-+\n",dashes,dashes);
669
void check_message_area()
671
Eterm *pos = global_heap;
672
Eterm *end = global_htop;
677
pos += thing_arityval(val);
678
else if(!is_immed(val))
679
if ((ptr_val(val) < global_heap || ptr_val(val) >= global_htop) &&
680
(ptr_val(val) < global_old_heap ||
681
ptr_val(val) >= global_old_hend))
683
erts_printf("check_message_area: Stray pointer found\n");
684
print_message_area();
685
erts_printf("Crashing to make it look real...\n");
692
static void print_process_memory(Process *p);
693
static void print_process_memory(Process *p)
695
ErlHeapFragment* bp = MBUF(p);
697
erts_printf("==============================\n");
698
erts_printf("|| Memory info for %T ||\n",p->id);
699
erts_printf("==============================\n");
701
erts_printf("-- %-*s ---%s-%s-%s-%s--\n",
702
PTR_SIZE, "PCB", dashes, dashes, dashes, dashes);
704
if (p->msg.first != NULL) {
706
erts_printf(" Message Queue:\n");
709
erts_printf("| 0x%0*lx | 0x%0*lx |\n",PTR_SIZE,
710
ERL_MESSAGE_TERM(mp),PTR_SIZE,ERL_MESSAGE_TOKEN(mp));
715
if (p->dictionary != NULL) {
716
int n = p->dictionary->used;
717
Eterm *ptr = p->dictionary->data;
718
erts_printf(" Dictionary: ");
719
while (n--) erts_printf("0x%0*lx ",PTR_SIZE,(unsigned long)ptr++);
723
if (p->debug_dictionary != NULL) {
724
int n = p->debug_dictionary->used;
725
Eterm *ptr = p->debug_dictionary->data;
726
erts_printf(" Debug Dictionary: ");
727
while (n--) erts_printf("0x%0*lx ",PTR_SIZE,(unsigned long)ptr++);
733
Eterm *ptr = p->arg_reg;
734
erts_printf(" Argument Registers: ");
735
while (n--) erts_printf("0x%0*lx ",PTR_SIZE,(unsigned long)*ptr++);
739
erts_printf(" Trace Token: 0x%0*lx\n",PTR_SIZE,p->seq_trace_token);
740
erts_printf(" Group Leader: 0x%0*lx\n",PTR_SIZE,p->group_leader);
741
erts_printf(" Fvalue: 0x%0*lx\n",PTR_SIZE,p->fvalue);
742
erts_printf(" Ftrace: 0x%0*lx\n",PTR_SIZE,p->ftrace);
747
erts_printf(" Remembered Roots:\n");
748
for (i = 0; i < p->nrr; i++)
749
if (p->rrsrc[i] != NULL)
750
erts_printf("0x%0*lx -> 0x%0*lx\n",
751
PTR_SIZE, (unsigned long)p->rrsrc[i],
752
PTR_SIZE, (unsigned long)p->rrma[i]);
757
erts_printf("+- %-*s -+ 0x%0*lx 0x%0*lx %s-%s-+\n",
759
PTR_SIZE, (unsigned long)STACK_TOP(p),
760
PTR_SIZE, (unsigned long)STACK_START(p),
762
print_untagged_memory(STACK_TOP(p),STACK_START(p));
764
erts_printf("+- %-*s -+ 0x%0*lx 0x%0*lx 0x%0*lx 0x%0*lx +\n",
766
PTR_SIZE, (unsigned long)HEAP_START(p),
767
PTR_SIZE, (unsigned long)HIGH_WATER(p),
768
PTR_SIZE, (unsigned long)HEAP_TOP(p),
769
PTR_SIZE, (unsigned long)HEAP_END(p));
770
print_untagged_memory(HEAP_START(p),HEAP_TOP(p));
773
erts_printf("+- %-*s -+ 0x%0*lx 0x%0*lx 0x%0*lx %s-+\n",
774
PTR_SIZE, "Old Heap",
775
PTR_SIZE, (unsigned long)OLD_HEAP(p),
776
PTR_SIZE, (unsigned long)OLD_HTOP(p),
777
PTR_SIZE, (unsigned long)OLD_HEND(p),
779
print_untagged_memory(OLD_HEAP(p),OLD_HTOP(p));
783
erts_printf("+- %-*s -+-%s-%s-%s-%s-+\n",
784
PTR_SIZE, "heap fragments",
785
dashes, dashes, dashes, dashes);
787
#if !defined(HEAP_FRAG_ELIM_TEST)
788
if ((ARITH_HEAP(p) >= bp->mem) &&
789
(ARITH_HEAP(p) < bp->mem + bp->size)) {
790
print_untagged_memory(bp->mem,ARITH_HEAP(p));
793
print_untagged_memory(bp->mem,bp->mem + bp->size);
794
#if !defined(HEAP_FRAG_ELIM_TEST)
802
void print_memory(Process *p)
805
print_process_memory(p);
810
Uint n = erts_num_active_procs;
812
for (i = 0; i < n; i++) {
813
Process *p = erts_active_procs[i];
814
print_process_memory(p);
817
erts_printf("==================\n");
818
erts_printf("|| Message area ||\n");
819
erts_printf("==================\n");
820
erts_printf("+-%s-+-%s-%s-%s-%s-+\n",
821
dashes,dashes,dashes,dashes,dashes);
822
erts_printf("| %-*s | 0x%0*lx - 0x%0*lx - 0x%0*lx%*s|\n",
824
PTR_SIZE, (unsigned long)global_heap,
825
PTR_SIZE, (unsigned long)global_htop,
826
PTR_SIZE, (unsigned long)global_hend,
828
erts_printf("+-%s-+-%s-%s-%s-%s-+\n",
829
dashes,dashes,dashes,dashes,dashes);
831
print_untagged_memory(global_heap,global_htop);
834
erts_printf("+-%s-+-%s-%s-%s-%s-+\n",
835
dashes,dashes,dashes,dashes,dashes);
836
erts_printf("| %-*s | 0x%0*lx - 0x%0*lx %*s |\n",
838
PTR_SIZE, (unsigned long)global_old_heap,
839
PTR_SIZE, (unsigned long)global_old_hend,
841
erts_printf("+-%s-+-%s-%s-%s-%s-+\n",
842
dashes,dashes,dashes,dashes,dashes);
846
INC_Page *page = inc_used_mem;
847
/* Genom att g� igenom fri-listan f�rst kan vi markera de
848
omr�den som inte �r allokerade och bara skriva ut de som
850
char markarea[INC_PAGESIZE];
854
Eterm *ptr = (Eterm*)page->start;
855
Eterm *end = (Eterm*)page->start + INC_PAGESIZE;
857
erts_printf("| %*s | This: 0x%0*lx Next: 0x%0*lx %*s|\n",
859
PTR_SIZE, (unsigned long)page,
860
PTR_SIZE, (unsigned long)page->next,
861
2 * PTR_SIZE - 8, "");
862
print_untagged_memory(ptr,end);
868
INC_MemBlock *this = inc_free_list;
870
erts_printf("-- %-*s --%s-%s-%s-%s-\n",PTR_SIZE+2,"Free list",
871
dashes,dashes,dashes,dashes);
873
erts_printf("Block @ 0x%0*lx sz: %8d prev: 0x%0*lx next: 0x%0*lx\n",
874
PTR_SIZE, (unsigned long)this,this->size,
875
PTR_SIZE, (unsigned long)this->prev,
876
PTR_SIZE, (unsigned long)this->next);
879
erts_printf("--%s---%s-%s-%s-%s--\n",
880
dashes,dashes,dashes,dashes,dashes);
883
if (inc_fromspc != NULL) {
884
erts_printf("-- fromspace - 0x%0*lx 0x%0*lx "
885
"------------------------------\n",
886
PTR_SIZE, (unsigned long)inc_fromspc,
887
PTR_SIZE, (unsigned long)inc_fromend);
888
print_untagged_memory(inc_fromspc,inc_fromend);
890
#endif /* INCREMENTAL */
895
void print_memory_info(Process *p)
898
erts_printf("======================================\n");
899
erts_printf("|| Memory info for %-12T ||\n",p->id);
900
erts_printf("======================================\n");
901
erts_printf("+- local heap ----%s-%s-%s-%s-+\n",
902
dashes,dashes,dashes,dashes);
903
erts_printf("| Young | 0x%0*lx - (0x%0*lx) - 0x%0*lx - 0x%0*lx |\n",
904
PTR_SIZE, (unsigned long)HEAP_START(p),
905
PTR_SIZE, (unsigned long)HIGH_WATER(p),
906
PTR_SIZE, (unsigned long)HEAP_TOP(p),
907
PTR_SIZE, (unsigned long)HEAP_END(p));
908
if (OLD_HEAP(p) != NULL)
909
erts_printf("| Old | 0x%0*lx - 0x%0*lx - 0x%0*lx %*s |\n",
910
PTR_SIZE, (unsigned long)OLD_HEAP(p),
911
PTR_SIZE, (unsigned long)OLD_HTOP(p),
912
PTR_SIZE, (unsigned long)OLD_HEND(p),
915
erts_printf("=================\n");
916
erts_printf("|| Memory info ||\n");
917
erts_printf("=================\n");
920
erts_printf("|- message area --%s-%s-%s-%s-|\n",
921
dashes,dashes,dashes,dashes);
922
erts_printf("| Young | 0x%0*lx - 0x%0*lx - 0x%0*lx %*s |\n",
923
PTR_SIZE, (unsigned long)global_heap,
924
PTR_SIZE, (unsigned long)global_htop,
925
PTR_SIZE, (unsigned long)global_hend,
927
erts_printf("| Old | 0x%0*lx - 0x%0*lx %*s |\n",
928
PTR_SIZE, (unsigned long)global_old_heap,
929
PTR_SIZE, (unsigned long)global_old_hend,
933
if (inc_fromspc != NULL)
934
erts_printf("| Frmsp | 0x%0*lx - 0x%0*lx %*s |\n",
935
PTR_SIZE, (unsigned long)inc_fromspc,
936
PTR_SIZE, (unsigned long)inc_fromend,
939
erts_printf("+-----------------%s-%s-%s-%s-+\n",dashes,dashes,dashes,dashes);