-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use jemalloc to trace thread allocation #8844
Merged
Merged
Changes from 33 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
5987e73
z
CalvinNeo 79d847c
instant
CalvinNeo 279e7a9
fix
CalvinNeo 51aa25b
fix
CalvinNeo d8ea43b
zzzzz
CalvinNeo e0705b1
fmt
CalvinNeo c73606a
h
CalvinNeo aede44c
f
CalvinNeo eb416dc
Merge branch 'master' into jemalloc-alloc
CalvinNeo 33c06a9
co
CalvinNeo c433699
Update dbms/src/Storages/KVStore/FFI/ProxyFFI.cpp
CalvinNeo 95cb885
Merge branch 'jemalloc-alloc' of github.com:CalvinNeo/tics into jemal…
CalvinNeo c2a78f7
fix
CalvinNeo dc8159d
t1
CalvinNeo 8232c97
t1
CalvinNeo b662e97
reset
CalvinNeo c3fb1a4
fix
CalvinNeo f8f5039
z
CalvinNeo 22f54b2
update proxy
CalvinNeo 54635f6
Update dbms/src/Server/Server.cpp
CalvinNeo 1f5b6b1
add tests
CalvinNeo ca7e114
Merge branch 'jemalloc-alloc' of github.com:CalvinNeo/tics into jemal…
CalvinNeo c99a306
fix
CalvinNeo 41c865d
Update dbms/src/Storages/KVStore/FFI/ProxyFFI.cpp
CalvinNeo f9c4ed3
f
CalvinNeo 1050cdf
f
CalvinNeo 0f39d24
f
CalvinNeo 9a5a426
x
CalvinNeo d9d141d
x
CalvinNeo b15004a
x
CalvinNeo a97525b
Update dbms/src/Common/TiFlashMetrics.cpp
CalvinNeo b45c47a
x
CalvinNeo 0d82b86
Merge branch 'jemalloc-alloc' of github.com:CalvinNeo/tics into jemal…
CalvinNeo 5fa20a1
df
CalvinNeo b384af1
df2
CalvinNeo 0759459
fix
CalvinNeo 25170e0
proxy
CalvinNeo 5d10880
Merge remote-tracking branch 'upstream/master' into jemalloc-alloc
CalvinNeo d3356ac
fix2
CalvinNeo 2eead98
fix2
CalvinNeo b41346b
ft
CalvinNeo a9aaafa
ft
CalvinNeo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule tiflash-proxy
updated
19 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2024 PingCAP, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include <Common/MemoryTrace.h> | ||
|
||
#ifdef USE_JEMALLOC | ||
#include <jemalloc/jemalloc.h> | ||
#endif | ||
|
||
namespace DB | ||
{ | ||
std::tuple<uint64_t *, uint64_t *> getAllocDeallocPtr() | ||
{ | ||
#ifdef USE_JEMALLOC | ||
uint64_t * ptr1 = nullptr; | ||
uint64_t size1 = sizeof ptr1; | ||
je_mallctl("thread.allocatedp", (void *)&ptr1, &size1, nullptr, 0); | ||
uint64_t * ptr2 = nullptr; | ||
uint64_t size2 = sizeof ptr2; | ||
je_mallctl("thread.deallocatedp", (void *)&ptr2, &size2, nullptr, 0); | ||
return std::make_tuple(ptr1, ptr2); | ||
#else | ||
return std::make_tuple(nullptr, nullptr); | ||
#endif | ||
} | ||
} // namespace DB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2024 PingCAP, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#pragma once | ||
|
||
#include <tuple> | ||
|
||
namespace DB | ||
{ | ||
std::tuple<uint64_t *, uint64_t *> getAllocDeallocPtr(); | ||
} // namespace DB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This filename is easy to confuse with
MemoryTracker.cpp
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed into MemoryAllocTracker