Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
llvm-watermarker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nagayama15
llvm-watermarker
Commits
fda8ef19
Commit
fda8ef19
authored
Jan 16, 2019
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jemallocへの埋め込み実験を追加
parent
2e0e0053
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1495 additions
and
0 deletions
+1495
-0
.gitmodules
.gitmodules
+3
-0
common.mk
common.mk
+1
-0
Makefile
example/Makefile
+2
-0
Makefile
example/jemalloc/Makefile
+72
-0
jemalloc_internal_defs.h
...malloc/include/jemalloc/internal/jemalloc_internal_defs.h
+376
-0
jemalloc_preamble.h
...le/jemalloc/include/jemalloc/internal/jemalloc_preamble.h
+194
-0
private_namespace.h
...le/jemalloc/include/jemalloc/internal/private_namespace.h
+416
-0
jemalloc.h
example/jemalloc/include/jemalloc/jemalloc.h
+425
-0
jemalloc
example/jemalloc/jemalloc
+1
-0
aggregate.sh
scripts/aggregate.sh
+4
-0
analyze.sh
scripts/analyze.sh
+1
-0
No files found.
.gitmodules
View file @
fda8ef19
...
@@ -13,3 +13,6 @@
...
@@ -13,3 +13,6 @@
[submodule "example/tree/tree"]
[submodule "example/tree/tree"]
path = example/tree/tree
path = example/tree/tree
url = git://github.com/execjosh/tree.git
url = git://github.com/execjosh/tree.git
[submodule "example/jemalloc/jemalloc"]
path = example/jemalloc/jemalloc
url = git://github.com/jemalloc/jemalloc.git
common.mk
View file @
fda8ef19
.DEFAULT_GOAL := all
.DEFAULT_GOAL := all
BUILD_TYPE := release
BUILD_TYPE := release
#BUILD_TYPE := debug
ROOT := $(realpath ${PWD})
ROOT := $(realpath ${PWD})
CD := $(realpath ${CURDIR})
CD := $(realpath ${CURDIR})
...
...
example/Makefile
View file @
fda8ef19
...
@@ -7,6 +7,7 @@ all:
...
@@ -7,6 +7,7 @@ all:
${
MAKE
}
-C
lua all
${
MAKE
}
-C
lua all
${
MAKE
}
-C
cJSON all
${
MAKE
}
-C
cJSON all
${
MAKE
}
-C
tree all
${
MAKE
}
-C
tree all
${
MAKE
}
-C
jemalloc all
${
MAKE
}
-C
fizzbuzz-rs all
${
MAKE
}
-C
fizzbuzz-rs all
${
MAKE
}
-C
numguess-rs all
${
MAKE
}
-C
numguess-rs all
...
@@ -17,6 +18,7 @@ test:
...
@@ -17,6 +18,7 @@ test:
${
MAKE
}
-C
lua
test
${
MAKE
}
-C
lua
test
${
MAKE
}
-C
cJSON
test
${
MAKE
}
-C
cJSON
test
${
MAKE
}
-C
tree
test
${
MAKE
}
-C
tree
test
${
MAKE
}
-C
jemalloc
test
${
MAKE
}
-C
fizzbuzz-rs
test
${
MAKE
}
-C
fizzbuzz-rs
test
${
MAKE
}
-C
numguess-rs
test
${
MAKE
}
-C
numguess-rs
test
...
...
example/jemalloc/Makefile
0 → 100644
View file @
fda8ef19
include
../../common.mk
WATERMARK
:=
jemalloc-watermarking
CFLAGS
:=
-std
=
gnu11
-Wno-ignored-attributes
-D_GNU_SOURCE
-Ijemalloc
/include
-Iinclude
CFLAGS_debug
:=
-O0
CFLAGS_release
:=
-O2
-DNDEBUG
CFLAGS
+=
${
CFLAGS_
${
BUILD_TYPE
}}
SRCS
:=
\
jemalloc/src/arena.c
\
jemalloc/src/background_thread.c
\
jemalloc/src/base.c
\
jemalloc/src/bin.c
\
jemalloc/src/bitmap.c
\
jemalloc/src/ckh.c
\
jemalloc/src/ctl.c
\
jemalloc/src/div.c
\
jemalloc/src/extent.c
\
jemalloc/src/extent_dss.c
\
jemalloc/src/extent_mmap.c
\
jemalloc/src/hash.c
\
jemalloc/src/hook.c
\
jemalloc/src/jemalloc.c
\
jemalloc/src/large.c
\
jemalloc/src/log.c
\
jemalloc/src/malloc_io.c
\
jemalloc/src/mutex.c
\
jemalloc/src/mutex_pool.c
\
jemalloc/src/nstime.c
\
jemalloc/src/pages.c
\
jemalloc/src/prng.c
\
jemalloc/src/prof.c
\
jemalloc/src/rtree.c
\
jemalloc/src/sc.c
\
jemalloc/src/stats.c
\
jemalloc/src/sz.c
\
jemalloc/src/tcache.c
\
jemalloc/src/test_hooks.c
\
jemalloc/src/ticker.c
\
jemalloc/src/tsd.c
\
jemalloc/src/witness.c
OBJS
:=
${
SRCS
:jemalloc/src/%.c
=
${
OBJ_DIR
}
/%.o
}
OBJS_WM
:=
${
OBJS
:%.o
=%-wm.o
}
LLS
:=
${
OBJS
:.o
=.ll
}
LLS_WM
:=
${
OBJS_WM
:.o
=.ll
}
.PRECIOUS
:
${LLS} ${LLS_WM}
all
:
\
${BIN_DIR}/libjemalloc.a
\
${BIN_DIR}/libjemalloc-wm.a
${BIN_DIR}/libjemalloc.a
:
${OBJS}
${BIN_DIR}/libjemalloc-wm.a
:
${OBJS_WM}
${BIN_DIR}/%.a
:
@
mkdir
-p
${
@D
}
ar rcs
$@
$^
${OBJ_DIR}/%.ll
:
jemalloc/src/%.c
@
mkdir
-p
${
@D
}
clang
-S
-emit-llvm
${
CFLAGS
}
-o
$@
$<
${OBJ_DIR}/%.o
:
${OBJ_DIR}/%.ll
@
mkdir
-p
${
@D
}
clang
-o
$@
-c
$<
${OBJ_DIR}/%-wm.ll
:
${OBJ_DIR}/%.ll
opt
-load
=
${
ROOT
}
/bin/
${
BUILD_TYPE
}
/src/nykk.so
-block-wm
-watermark
=
${
WATERMARK
}
-S
-o
${
@
:%-wm.ll
=%-block-wm.ll
}
$<
2>
${
@
:%-wm.ll
=%-block-wm.txt
}
opt
-load
=
${
ROOT
}
/bin/
${
BUILD_TYPE
}
/src/nykk.so
-inst-wm
-watermark
=
${
WATERMARK
}
-S
-o
$@
${
@
:%-wm.ll
=%-block-wm.ll
}
2>
${
@
:%-wm.ll
=%-inst-wm.txt
}
example/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
0 → 100644
View file @
fda8ef19
This diff is collapsed.
Click to expand it.
example/jemalloc/include/jemalloc/internal/jemalloc_preamble.h
0 → 100644
View file @
fda8ef19
#ifndef JEMALLOC_PREAMBLE_H
#define JEMALLOC_PREAMBLE_H
#include "jemalloc_internal_defs.h"
#include "jemalloc/internal/jemalloc_internal_decls.h"
#ifdef JEMALLOC_UTRACE
#include <sys/ktrace.h>
#endif
#define JEMALLOC_NO_DEMANGLE
#ifdef JEMALLOC_JET
# undef JEMALLOC_IS_MALLOC
# define JEMALLOC_N(n) jet_##n
# include "jemalloc/internal/public_namespace.h"
# define JEMALLOC_NO_RENAME
# include "../jemalloc.h"
# undef JEMALLOC_NO_RENAME
#else
# define JEMALLOC_N(n) je_##n
# include "../jemalloc.h"
#endif
#if defined(JEMALLOC_OSATOMIC)
#include <libkern/OSAtomic.h>
#endif
#ifdef JEMALLOC_ZONE
#include <mach/mach_error.h>
#include <mach/mach_init.h>
#include <mach/vm_map.h>
#endif
#include "jemalloc/internal/jemalloc_internal_macros.h"
/*
* Note that the ordering matters here; the hook itself is name-mangled. We
* want the inclusion of hooks to happen early, so that we hook as much as
* possible.
*/
#ifndef JEMALLOC_NO_PRIVATE_NAMESPACE
# ifndef JEMALLOC_JET
# include "jemalloc/internal/private_namespace.h"
# else
# include "jemalloc/internal/private_namespace_jet.h"
# endif
#endif
#include "jemalloc/internal/test_hooks.h"
#ifdef JEMALLOC_DEFINE_MADVISE_FREE
# define JEMALLOC_MADV_FREE 8
#endif
static
const
bool
config_debug
=
#ifdef JEMALLOC_DEBUG
true
#else
false
#endif
;
static
const
bool
have_dss
=
#ifdef JEMALLOC_DSS
true
#else
false
#endif
;
static
const
bool
have_madvise_huge
=
#ifdef JEMALLOC_HAVE_MADVISE_HUGE
true
#else
false
#endif
;
static
const
bool
config_fill
=
#ifdef JEMALLOC_FILL
true
#else
false
#endif
;
static
const
bool
config_lazy_lock
=
#ifdef JEMALLOC_LAZY_LOCK
true
#else
false
#endif
;
static
const
char
*
const
config_malloc_conf
=
JEMALLOC_CONFIG_MALLOC_CONF
;
static
const
bool
config_prof
=
#ifdef JEMALLOC_PROF
true
#else
false
#endif
;
static
const
bool
config_prof_libgcc
=
#ifdef JEMALLOC_PROF_LIBGCC
true
#else
false
#endif
;
static
const
bool
config_prof_libunwind
=
#ifdef JEMALLOC_PROF_LIBUNWIND
true
#else
false
#endif
;
static
const
bool
maps_coalesce
=
#ifdef JEMALLOC_MAPS_COALESCE
true
#else
false
#endif
;
static
const
bool
config_stats
=
#ifdef JEMALLOC_STATS
true
#else
false
#endif
;
static
const
bool
config_tls
=
#ifdef JEMALLOC_TLS
true
#else
false
#endif
;
static
const
bool
config_utrace
=
#ifdef JEMALLOC_UTRACE
true
#else
false
#endif
;
static
const
bool
config_xmalloc
=
#ifdef JEMALLOC_XMALLOC
true
#else
false
#endif
;
static
const
bool
config_cache_oblivious
=
#ifdef JEMALLOC_CACHE_OBLIVIOUS
true
#else
false
#endif
;
/*
* Undocumented, for jemalloc development use only at the moment. See the note
* in jemalloc/internal/log.h.
*/
static
const
bool
config_log
=
#ifdef JEMALLOC_LOG
true
#else
false
#endif
;
#if defined(_WIN32) || defined(JEMALLOC_HAVE_SCHED_GETCPU)
/* Currently percpu_arena depends on sched_getcpu. */
#define JEMALLOC_PERCPU_ARENA
#endif
static
const
bool
have_percpu_arena
=
#ifdef JEMALLOC_PERCPU_ARENA
true
#else
false
#endif
;
/*
* Undocumented, and not recommended; the application should take full
* responsibility for tracking provenance.
*/
static
const
bool
force_ivsalloc
=
#ifdef JEMALLOC_FORCE_IVSALLOC
true
#else
false
#endif
;
static
const
bool
have_background_thread
=
#ifdef JEMALLOC_BACKGROUND_THREAD
true
#else
false
#endif
;
#endif
/* JEMALLOC_PREAMBLE_H */
example/jemalloc/include/jemalloc/internal/private_namespace.h
0 → 100644
View file @
fda8ef19
This diff is collapsed.
Click to expand it.
example/jemalloc/include/jemalloc/jemalloc.h
0 → 100644
View file @
fda8ef19
This diff is collapsed.
Click to expand it.
jemalloc
@
bbe8e6a9
Subproject commit bbe8e6a9097203c7b29140b5410c787a6e204593
scripts/aggregate.sh
View file @
fda8ef19
...
@@ -54,6 +54,8 @@ echo "==== cJSON block-wm ===="
...
@@ -54,6 +54,8 @@ echo "==== cJSON block-wm ===="
h1 obj/
$1
/example/cJSON/
*
-block-wm
.txt
h1 obj/
$1
/example/cJSON/
*
-block-wm
.txt
echo
"==== tree block-wm ===="
echo
"==== tree block-wm ===="
h1 obj/
$1
/example/tree/
*
-block-wm
.txt
h1 obj/
$1
/example/tree/
*
-block-wm
.txt
echo
"==== jemalloc block-wm ===="
h1 obj/
$1
/example/jemalloc/
*
-block-wm
.txt
echo
"==== fizzbuzz-rs block-wm ===="
echo
"==== fizzbuzz-rs block-wm ===="
h1 obj/
$1
/example/fizzbuzz-rs/
*
-block-wm
.txt
h1 obj/
$1
/example/fizzbuzz-rs/
*
-block-wm
.txt
echo
"==== numguess-rs block-wm ===="
echo
"==== numguess-rs block-wm ===="
...
@@ -69,6 +71,8 @@ echo "==== cJSON inst-wm ===="
...
@@ -69,6 +71,8 @@ echo "==== cJSON inst-wm ===="
h2 obj/
$1
/example/cJSON/
*
-inst-wm
.txt
h2 obj/
$1
/example/cJSON/
*
-inst-wm
.txt
echo
"==== tree inst-wm ===="
echo
"==== tree inst-wm ===="
h2 obj/
$1
/example/tree/
*
-inst-wm
.txt
h2 obj/
$1
/example/tree/
*
-inst-wm
.txt
echo
"==== jemalloc inst-wm ===="
h2 obj/
$1
/example/jemalloc/
*
-inst-wm
.txt
echo
"==== fizzbuzz-rs inst-wm ===="
echo
"==== fizzbuzz-rs inst-wm ===="
h2 obj/
$1
/example/fizzbuzz-rs/
*
-inst-wm
.txt
h2 obj/
$1
/example/fizzbuzz-rs/
*
-inst-wm
.txt
echo
"==== numguess-rs inst-wm ===="
echo
"==== numguess-rs inst-wm ===="
...
...
scripts/analyze.sh
View file @
fda8ef19
...
@@ -26,3 +26,4 @@ h example/zlib/zlib/*.c
...
@@ -26,3 +26,4 @@ h example/zlib/zlib/*.c
h example/lua/lua/
*
.c
h example/lua/lua/
*
.c
h example/cJSON/cJSON/cJSON.c example/cJSON/cJSON/cJSON_Utils.c
h example/cJSON/cJSON/cJSON.c example/cJSON/cJSON/cJSON_Utils.c
h example/tree/tree/
*
.c
h example/tree/tree/
*
.c
h
`
ls
example/jemalloc/jemalloc/src/
*
.c |
awk
-F
'example/jemalloc/jemalloc/src/test_hooks.c'
-F
'example/jemalloc/jemalloc/src/zone.c'
'{print $NF}'
`
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment