Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
743193e9
Commit
743193e9
authored
Aug 01, 2014
by
John Esmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FT-300 Use portable printf format strings in the block allocator's
tracing code
parent
138182e2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
ft/serialize/block_allocator.cc
ft/serialize/block_allocator.cc
+9
-11
No files found.
ft/serialize/block_allocator.cc
View file @
743193e9
...
@@ -457,8 +457,8 @@ void block_allocator::validate() const {
...
@@ -457,8 +457,8 @@ void block_allocator::validate() const {
void
block_allocator
::
_trace_create
(
void
)
{
void
block_allocator
::
_trace_create
(
void
)
{
if
(
ba_trace_file
!=
nullptr
)
{
if
(
ba_trace_file
!=
nullptr
)
{
toku_mutex_lock
(
&
_trace_lock
);
toku_mutex_lock
(
&
_trace_lock
);
fprintf
(
ba_trace_file
,
"ba_trace_create %p %
lu %lu
\n
"
,
this
,
fprintf
(
ba_trace_file
,
"ba_trace_create %p %
"
PRIu64
" %"
PRIu64
"
\n
"
,
_reserve_at_beginning
,
_alignment
);
this
,
_reserve_at_beginning
,
_alignment
);
toku_mutex_unlock
(
&
_trace_lock
);
toku_mutex_unlock
(
&
_trace_lock
);
fflush
(
ba_trace_file
);
fflush
(
ba_trace_file
);
...
@@ -468,10 +468,11 @@ void block_allocator::_trace_create(void) {
...
@@ -468,10 +468,11 @@ void block_allocator::_trace_create(void) {
void
block_allocator
::
_trace_create_from_blockpairs
(
void
)
{
void
block_allocator
::
_trace_create_from_blockpairs
(
void
)
{
if
(
ba_trace_file
!=
nullptr
)
{
if
(
ba_trace_file
!=
nullptr
)
{
toku_mutex_lock
(
&
_trace_lock
);
toku_mutex_lock
(
&
_trace_lock
);
fprintf
(
ba_trace_file
,
"ba_trace_create_from_blockpairs %p %
lu %lu "
,
this
,
fprintf
(
ba_trace_file
,
"ba_trace_create_from_blockpairs %p %
"
PRIu64
" %"
PRIu64
" "
,
_reserve_at_beginning
,
_alignment
);
this
,
_reserve_at_beginning
,
_alignment
);
for
(
uint64_t
i
=
0
;
i
<
_n_blocks
;
i
++
)
{
for
(
uint64_t
i
=
0
;
i
<
_n_blocks
;
i
++
)
{
fprintf
(
ba_trace_file
,
"[%lu %lu] "
,
_blocks_array
[
i
].
offset
,
_blocks_array
[
i
].
size
);
fprintf
(
ba_trace_file
,
"[%"
PRIu64
" %"
PRIu64
"] "
,
_blocks_array
[
i
].
offset
,
_blocks_array
[
i
].
size
);
}
}
fprintf
(
ba_trace_file
,
"
\n
"
);
fprintf
(
ba_trace_file
,
"
\n
"
);
toku_mutex_unlock
(
&
_trace_lock
);
toku_mutex_unlock
(
&
_trace_lock
);
...
@@ -493,10 +494,8 @@ void block_allocator::_trace_destroy(void) {
...
@@ -493,10 +494,8 @@ void block_allocator::_trace_destroy(void) {
void
block_allocator
::
_trace_alloc
(
uint64_t
size
,
uint64_t
heat
,
uint64_t
offset
)
{
void
block_allocator
::
_trace_alloc
(
uint64_t
size
,
uint64_t
heat
,
uint64_t
offset
)
{
if
(
ba_trace_file
!=
nullptr
)
{
if
(
ba_trace_file
!=
nullptr
)
{
toku_mutex_lock
(
&
_trace_lock
);
toku_mutex_lock
(
&
_trace_lock
);
fprintf
(
ba_trace_file
,
"ba_trace_alloc %p %lu %lu %lu
\n
"
,
this
,
fprintf
(
ba_trace_file
,
"ba_trace_alloc %p %"
PRIu64
" %"
PRIu64
" %"
PRIu64
"
\n
"
,
static_cast
<
unsigned
long
>
(
size
),
this
,
size
,
heat
,
offset
);
static_cast
<
unsigned
long
>
(
heat
),
static_cast
<
unsigned
long
>
(
offset
));
toku_mutex_unlock
(
&
_trace_lock
);
toku_mutex_unlock
(
&
_trace_lock
);
fflush
(
ba_trace_file
);
fflush
(
ba_trace_file
);
...
@@ -506,8 +505,7 @@ void block_allocator::_trace_alloc(uint64_t size, uint64_t heat, uint64_t offset
...
@@ -506,8 +505,7 @@ void block_allocator::_trace_alloc(uint64_t size, uint64_t heat, uint64_t offset
void
block_allocator
::
_trace_free
(
uint64_t
offset
)
{
void
block_allocator
::
_trace_free
(
uint64_t
offset
)
{
if
(
ba_trace_file
!=
nullptr
)
{
if
(
ba_trace_file
!=
nullptr
)
{
toku_mutex_lock
(
&
_trace_lock
);
toku_mutex_lock
(
&
_trace_lock
);
fprintf
(
ba_trace_file
,
"ba_trace_free %p %lu
\n
"
,
this
,
fprintf
(
ba_trace_file
,
"ba_trace_free %p %"
PRIu64
"
\n
"
,
this
,
offset
);
static_cast
<
unsigned
long
>
(
offset
));
toku_mutex_unlock
(
&
_trace_lock
);
toku_mutex_unlock
(
&
_trace_lock
);
fflush
(
ba_trace_file
);
fflush
(
ba_trace_file
);
...
...
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