Skip to content

Don't quite get why profiling is still off  #2715

@Static-Flow

Description

@Static-Flow

Much as the title suggests, I cannot seem to get profiling to be enabled. I've enabled it in the library when I built it using the https://github.com/jemalloc/jemalloc/blob/dev/INSTALL.md#with-msys build steps:

nfigure:17097: result: abs_srcroot          : /c/Users/Tanner/tools/jemalloc-5.3.0/
configure:17099: result: objroot            : 
configure:17101: result: abs_objroot        : /c/Users/Tanner/tools/jemalloc-5.3.0/
configure:17103: result: 
configure:17105: result: JEMALLOC_PREFIX    : je_
configure:17107: result: JEMALLOC_PRIVATE_NAMESPACE
configure:17109: result:                    : je_
configure:17111: result: install_suffix     : 
configure:17113: result: malloc_conf        : 
configure:17115: result: documentation      : 1
configure:17117: result: shared libs        : 1
configure:17119: result: static libs        : 1
configure:17121: result: autogen            : 0
configure:17123: result: debug              : 0
configure:17125: result: stats              : 1
configure:17127: result: experimental_smallocx : 0
---
configure:17129: result: prof               : 1
configure:17131: result: prof-libunwind     : 0
configure:17133: result: prof-libgcc        : 1
configure:17135: result: prof-gcc           : 0
---
configure:17137: result: fill               : 1
configure:17139: result: utrace             : 0
configure:17141: result: xmalloc            : 0
configure:17143: result: log                : 0
configure:17145: result: lazy_lock          : 0
configure:17147: result: cache-oblivious    : 1
configure:17149: result: cxx                : 1

It's linked for the program:
$build_env cc test.c -o ex_stats_print -I/c/Users/Tanner/tools/jemalloc-5.3.0/include -L/c/Users/Tanner/tools/jemalloc-5.3.0/lib -Wl,-rpath,/c/Users/Tanner/tools/jemalloc-5.3.0/lib -ljemalloc -lstdc++ -lgcc

exported the conf:
export MALLOC_CONF=prof:true,lg_prof_interval:16,lg_prof_sample:8,prof_final:true,prof_leak:true,prof_active:true

even tried running it inline with the binary, who's code is this:

#include <stdlib.h>
#include <jemalloc/jemalloc.h>

void
do_something(size_t i) {
        // Leak some memory.
        malloc(i * 100);
}

int
main(int argc, char **argv) {
        for (size_t i = 0; i < 1000; i++) {
                do_something(i);
        }
        je_malloc_stats_print(NULL, NULL, NULL);
        return 0;
}

which outputs this, but no dump:

___ Begin jemalloc statistics ___
Version: "5.3.0-0-g54eaed1d8b56b1aa528be3bdd1877e59c56fa90c"
Build-time option settings
  config.cache_oblivious: true
  config.debug: false
  config.fill: true
  config.lazy_lock: false
  config.malloc_conf: ""
  config.opt_safety_checks: false
  config.prof: true
  config.prof_libgcc: true
  config.prof_libunwind: false
  config.stats: true
  config.utrace: false
  config.xmalloc: false
Run-time option settings
  opt.abort: false
  opt.abort_conf: false
  opt.cache_oblivious: true
  opt.confirm_conf: false
  opt.retain: true
  opt.dss: "secondary"
  opt.narenas: 128
  opt.percpu_arena: "disabled"
  opt.oversize_threshold: 8388608
  opt.hpa: false
  opt.hpa_slab_max_alloc: 65536
  opt.hpa_hugification_threshold: 1992294
  opt.hpa_hugify_delay_ms: 10000
  opt.hpa_min_purge_interval_ms: 5000
  opt.hpa_dirty_mult: "0.25"
  opt.hpa_sec_nshards: 4
  opt.hpa_sec_max_alloc: 32768
  opt.hpa_sec_max_bytes: 262144
  opt.hpa_sec_bytes_after_flush: 131072
  opt.hpa_sec_batch_fill_extra: 0
  opt.metadata_thp: "disabled"
  opt.mutex_max_spin: 600
  opt.dirty_decay_ms: 10000 (arenas.dirty_decay_ms: 10000)
  opt.muzzy_decay_ms: 0 (arenas.muzzy_decay_ms: 0)
  opt.lg_extent_max_active_fit: 6
  opt.junk: "false"
  opt.zero: false
  opt.experimental_infallible_new: false
  opt.tcache: true
  opt.tcache_max: 32768
  opt.tcache_nslots_small_min: 20
  opt.tcache_nslots_small_max: 200
  opt.tcache_nslots_large: 20
  opt.lg_tcache_nslots_mul: 1
  opt.tcache_gc_incr_bytes: 65536
  opt.tcache_gc_delay_bytes: 0
  opt.lg_tcache_flush_small_div: 1
  opt.lg_tcache_flush_large_div: 1
  opt.thp: "not supported"
  opt.prof: false
  opt.prof_prefix: "jeprof"
  opt.prof_active: true (prof.active: false)
  opt.prof_thread_active_init: true (prof.thread_active_init: false)
  opt.lg_prof_sample: 19 (prof.lg_sample: 0)
  opt.prof_accum: false
  opt.lg_prof_interval: -1
  opt.prof_gdump: false
  opt.prof_final: false
  opt.prof_leak: false
  opt.prof_leak_error: false
  opt.stats_print: false
  opt.stats_print_opts: ""
  opt.stats_print: false
  opt.stats_print_opts: ""
  opt.stats_interval: -1
  opt.stats_interval_opts: ""
  opt.zero_realloc: "free"
Profiling settings
  prof.thread_active_init: false
  prof.active: false
  prof.gdump: false
  prof.interval: 0
  prof.lg_sample: 0

Not sure what I'm missing here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions