Skip to content
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

perfschema: support query cpu/memory/mutex/block/allocs/goroutines flamegraph by SQL (#12986) #13009

Merged
merged 4 commits into from
Oct 30, 2019

Conversation

lonng
Copy link
Contributor

@lonng lonng commented Oct 30, 2019

Signed-off-by: Lonng heng@lonng.org

Cherry-pick #12986 for release-3.0

What problem does this PR solve?

Currently, we need to get the profile file through the HTTP interface, and then convert the profile file into a flame map through an external tool. This process is very inefficient and cumbersome.

What is changed and how it works?

Use SQL to directly obtain flamegraph to help us improve diagnostic efficiency.
Note: This PR is part of Hackathon 2019 TBSSQL2.0.

select * from performance_schema.tidb_profile_allocs;
select * from performance_schema.tidb_profile_block;
select * from performance_schema.tidb_profile_cpu;
select * from performance_schema.tidb_goroutines;
select * from performance_schema.tidb_profile_memory;
select * from performance_schema.tidb_profile_mutex;

eg:

mysql> select * from performance_schema.tidb_profile_memory;
+-------------------------------------------------------------------------------------------------------------------+-------------+-------------+------------+-------+------------------------------------------------------------------------------------------------------+
| FUNCTION                                                                                                          | PERCENT_ABS | PERCENT_REL | ROOT_CHILD | DEPTH | FILE                                                                                                 |
+-------------------------------------------------------------------------------------------------------------------+-------------+-------------+------------+-------+------------------------------------------------------------------------------------------------------+
| root                                                                                                              | 100%        | 100%        |          0 |     0 | root                                                                                                 |
| ├─runtime.main                                                                                                    | 66.66%      | 66.66%      |          1 |     1 | runtime/proc.go:203                                                                                  |
| │ ├─main.main                                                                                                     | 61.93%      | 92.91%      |          1 |     2 | github.com/pingcap/tidb@/tidb-server/main.go:176                                                     |
| │ │ ├─main.createStoreAndDomain                                                                                   | 19.51%      | 31.50%      |          1 |     3 | github.com/pingcap/tidb@/tidb-server/main.go:238                                                     |
| │ │ │ └─github.com/pingcap/tidb/session.BootstrapSession                                                          | 19.51%      | 100%        |          1 |     4 | github.com/pingcap/tidb@/session/session.go:1579                                                     |
| │ │ │   └─github.com/pingcap/tidb/session.createSession                                                           | 19.51%      | 100%        |          1 |     5 | github.com/pingcap/tidb@/session/session.go:1670                                                     |
| │ │ │     └─github.com/pingcap/tidb/session.(*domainMap).Get                                                      | 19.51%      | 100%        |          1 |     6 | github.com/pingcap/tidb@/session/tidb.go:70                                                          |
| │ │ │       └─github.com/pingcap/tidb/util.RunWithRetry                                                           | 19.51%      | 100%        |          1 |     7 | github.com/pingcap/tidb@/util/misc.go:46                                                             |
| │ │ │         └─github.com/pingcap/tidb/session.(*domainMap).Get.func1                                            | 19.51%      | 100%        |          1 |     8 | github.com/pingcap/tidb@/session/tidb.go:78                                                          |
| │ │ │           ├─github.com/pingcap/tidb/domain.(*Domain).Init                                                   | 4.69%       | 24.06%      |          1 |     9 | github.com/pingcap/tidb@/domain/domain.go:604                                                        |
| │ │ │           │ └─github.com/pingcap/tidb/infoschema/perfschema.Init                                            | 4.69%       | 100%        |          1 |    10 | github.com/pingcap/tidb@/infoschema/perfschema/init.go:69                                            |
| │ │ │           │   └─sync.(*Once).Do                                                                             | 4.69%       | 100%        |          1 |    11 | sync/once.go:57                                                                                      |
| │ │ │           │     └─sync.(*Once).doSlow                                                                       | 4.69%       | 100%        |          1 |    12 | sync/once.go:66                                                                                      |
| │ │ │           │       └─github.com/pingcap/tidb/infoschema/perfschema.Init.func1                                | 4.69%       | 100%        |          1 |    13 | github.com/pingcap/tidb@/infoschema/perfschema/init.go:49                                            |
| │ │ │           │         └─github.com/pingcap/tidb/ddl.BuildTableInfoFromAST                                     | 4.69%       | 100%        |          1 |    14 | github.com/pingcap/tidb@/ddl/ddl_api.go:1282                                                         |
| │ │ │           │           └─github.com/pingcap/tidb/ddl.buildTableInfoWithCheck                                 | 4.69%       | 100%        |          1 |    15 | github.com/pingcap/tidb@/ddl/ddl_api.go:1314                                                         |
| │ │ │           │             └─github.com/pingcap/tidb/ddl.buildColumnsAndConstraints                            | 4.69%       | 100%        |          1 |    16 | github.com/pingcap/tidb@/ddl/ddl_api.go:269                                                          |
| │ │ │           │               └─github.com/pingcap/tidb/ddl.buildColumnAndConstraint                            | 4.69%       | 100%        |          1 |    17 | github.com/pingcap/tidb@/ddl/ddl_api.go:404                                                          |
| │ │ │           │                 └─github.com/pingcap/tidb/ddl.columnDefToCol                                    | 4.69%       | 100%        |          1 |    18 | github.com/pingcap/tidb@/ddl/ddl_api.go:489                                                          |
| │ │ │           └─github.com/pingcap/tidb/domain.(*Domain).Init                                                   | 14.81%      | 75.94%      |          1 |     9 | github.com/pingcap/tidb@/domain/domain.go:642                                                        |
| │ │ │             └─github.com/pingcap/tidb/ddl.NewDDL                                                            | 14.81%      | 100%        |          1 |    10 | github.com/pingcap/tidb@/ddl/ddl.go:355                                                              |
| │ │ │               └─github.com/pingcap/tidb/ddl.newDDL                                                          | 14.81%      | 100%        |          1 |    11 | github.com/pingcap/tidb@/ddl/ddl.go:396                                                              |
| │ │ │                 └─github.com/pingcap/tidb/ddl.(*ddl).start                                                  | 14.81%      | 100%        |          1 |    12 | github.com/pingcap/tidb@/ddl/ddl.go:440                                                              |
| │ │ │                   └─github.com/pingcap/tidb/ddl.(*ddl).newDeleteRangeManager                                | 14.81%      | 100%        |          1 |    13 | github.com/pingcap/tidb@/ddl/ddl.go:416                                                              |
| │ │ │                     └─github.com/pingcap/tidb/ddl.newDelRangeManager                                        | 14.81%      | 100%        |          1 |    14 | github.com/pingcap/tidb@/ddl/delete_range.go:78                                                      |
| │ │ └─main.createStoreAndDomain                                                                                   | 42.43%      | 68.50%      |          1 |     3 | github.com/pingcap/tidb@/tidb-server/main.go:235                                                     |
| │ │   └─github.com/pingcap/tidb/store.New                                                                         | 42.43%      | 100%        |          1 |     4 | github.com/pingcap/tidb@/store/store.go:51                                                           |
| │ │     └─github.com/pingcap/tidb/store.newStoreWithRetry                                                         | 42.43%      | 100%        |          1 |     5 | github.com/pingcap/tidb@/store/store.go:67                                                           |
| │ │       └─github.com/pingcap/tidb/util.RunWithRetry                                                             | 42.43%      | 100%        |          1 |     6 | github.com/pingcap/tidb@/util/misc.go:46                                                             |
| │ │         └─github.com/pingcap/tidb/store.newStoreWithRetry.func1                                               | 42.43%      | 100%        |          1 |     7 | github.com/pingcap/tidb@/store/store.go:69                                                           |
| │ │           └─github.com/pingcap/tidb/store/mockstore.MockDriver.Open                                           | 42.43%      | 100%        |          1 |     8 | github.com/pingcap/tidb@/store/mockstore/tikv.go:47                                                  |
| │ │             └─github.com/pingcap/tidb/store/mockstore.NewMockTikvStore                                        | 42.43%      | 100%        |          1 |     9 | github.com/pingcap/tidb@/store/mockstore/tikv.go:106                                                 |
| │ │               └─github.com/pingcap/tidb/store/mockstore/mocktikv.NewTiKVAndPDClient                           | 42.43%      | 100%        |          1 |    10 | github.com/pingcap/tidb@/store/mockstore/mocktikv/mock.go:30                                         |
| │ │                 └─github.com/pingcap/tidb/store/mockstore/mocktikv.NewMVCCLevelDB                             | 42.43%      | 100%        |          1 |    11 | github.com/pingcap/tidb@/store/mockstore/mocktikv/mvcc_leveldb.go:124                                |
| │ │                   └─github.com/pingcap/goleveldb/leveldb.OpenFile                                             | 42.43%      | 100%        |          1 |    12 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/db.go:216                    |
| │ │                     └─github.com/pingcap/goleveldb/leveldb.Open                                               | 42.43%      | 100%        |          1 |    13 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/db.go:194                    |
| │ │                       └─github.com/pingcap/goleveldb/leveldb.openDB                                           | 42.43%      | 100%        |          1 |    14 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/db.go:122                    |
| │ │                         ├─github.com/pingcap/goleveldb/leveldb.(*DB).recoverJournal                           | 4.88%       | 11.50%      |          1 |    15 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/db.go:617                    |
| │ │                         │ └─github.com/pingcap/goleveldb/leveldb.(*session).commit                            | 4.88%       | 100%        |          1 |    16 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/session.go:199               |
| │ │                         │   └─github.com/pingcap/goleveldb/leveldb.(*session).newManifest                     | 4.88%       | 100%        |          1 |    17 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/session_util.go:198          |
| │ │                         │     └─github.com/pingcap/goleveldb/leveldb/journal.NewWriter                        | 4.88%       | 100%        |          1 |    18 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/journal/journal.go:370       |
| │ │                         └─github.com/pingcap/goleveldb/leveldb.(*DB).recoverJournal                           | 37.55%      | 88.50%      |          1 |    15 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/db.go:610                    |
| │ │                           └─github.com/pingcap/goleveldb/leveldb.(*DB).newMem                                 | 37.55%      | 100%        |          1 |    16 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/db_state.go:147              |
| │ │                             └─github.com/pingcap/goleveldb/leveldb.(*DB).mpoolGet                             | 37.55%      | 100%        |          1 |    17 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/db_state.go:90               |
| │ │                               └─github.com/pingcap/goleveldb/leveldb/memdb.New                                | 37.55%      | 100%        |          1 |    18 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/memdb/memdb.go:519           |
| │ └─main.main                                                                                                     | 4.73%       | 7.09%       |          1 |     2 | github.com/pingcap/tidb@/tidb-server/main.go:177                                                     |
| │   └─main.createServer                                                                                           | 4.73%       | 100%        |          1 |     3 | github.com/pingcap/tidb@/tidb-server/main.go:555                                                     |
| │     └─github.com/pingcap/tidb/server.NewServer                                                                  | 4.73%       | 100%        |          1 |     4 | github.com/pingcap/tidb@/server/server.go:200                                                        |
| │       └─github.com/pingcap/tidb/server.NewTokenLimiter                                                          | 4.73%       | 100%        |          1 |     5 | github.com/pingcap/tidb@/server/tokenlimiter.go:38                                                   |
| ├─runtime.main                                                                                                    | 23.90%      | 23.90%      |          2 |     1 | runtime/proc.go:190                                                                                  |
| │ └─runtime.doInit                                                                                                | 23.90%      | 100%        |          2 |     2 | runtime/proc.go:5217                                                                                 |
| │   └─runtime.doInit                                                                                              | 23.90%      | 100%        |          2 |     3 | runtime/proc.go:5217                                                                                 |
| │     ├─runtime.doInit                                                                                            | 19.20%      | 80.36%      |          2 |     4 | runtime/proc.go:5217                                                                                 |
| │     │ └─runtime.doInit                                                                                          | 19.20%      | 100%        |          2 |     5 | runtime/proc.go:5217                                                                                 |
| │     │   └─runtime.doInit                                                                                        | 19.20%      | 100%        |          2 |     6 | runtime/proc.go:5222                                                                                 |
| │     │     ├─github.com/pingcap/parser.init.0                                                                    | 4.70%       | 24.49%      |          2 |     7 | github.com/pingcap/parser@v0.0.0-20191025082927-f8adf1670b97/misc.go:114                             |
| │     │     │ └─github.com/pingcap/parser.initTokenString                                                         | 4.70%       | 100%        |          2 |     8 | github.com/pingcap/parser@v0.0.0-20191025082927-f8adf1670b97/misc.go:61                              |
| │     │     ├─github.com/pingcap/parser.init                                                                      | 4.88%       | 25.40%      |          2 |     7 | github.com/pingcap/parser@v0.0.0-20191025082927-f8adf1670b97/parser.go:691                           |
| │     │     ├─github.com/pingcap/parser.init                                                                      | 4.82%       | 25.11%      |          2 |     7 | github.com/pingcap/parser@v0.0.0-20191025082927-f8adf1670b97/parser.go:136                           |
| │     │     └─github.com/pingcap/tipb/go-tipb.init                                                                | 4.80%       | 25.01%      |          2 |     7 | github.com/pingcap/tipb@v0.0.0-20191015023537-709b39e7f8bb/go-tipb/expression.pb.go:1166             |
| │     └─runtime.doInit                                                                                            | 4.69%       | 19.64%      |          2 |     4 | runtime/proc.go:5222                                                                                 |
| │       └─github.com/pingcap/tidb/infoschema.init.0                                                               | 4.69%       | 100%        |          2 |     5 | github.com/pingcap/tidb@/infoschema/infoschema.go:375                                                |
| │         └─github.com/pingcap/tidb/infoschema.initInfoSchemaDB                                                   | 4.69%       | 100%        |          2 |     6 | github.com/pingcap/tidb@/infoschema/infoschema.go:386                                                |
| │           └─github.com/pingcap/tidb/infoschema.buildTableMeta                                                   | 4.69%       | 100%        |          2 |     7 | github.com/pingcap/tidb@/infoschema/tables.go:124                                                    |
| │             └─github.com/pingcap/tidb/infoschema.buildColumnInfo                                                | 4.69%       | 100%        |          2 |     8 | github.com/pingcap/tidb@/infoschema/tables.go:117                                                    |
| ├─github.com/pingcap/tidb/server.(*Server).startHTTPServer                                                        | 4.75%       | 4.75%       |          3 |     1 | github.com/pingcap/tidb@/server/http_status.go:73                                                    |
| │ └─github.com/prometheus/client_golang/prometheus.Handler                                                        | 4.75%       | 100%        |          3 |     2 | github.com/prometheus/client_golang@v0.9.0/prometheus/http.go:66                                     |
| │   └─github.com/prometheus/client_golang/prometheus.InstrumentHandler                                            | 4.75%       | 100%        |          3 |     3 | github.com/prometheus/client_golang@v0.9.0/prometheus/http.go:162                                    |
| │     └─github.com/prometheus/client_golang/prometheus.InstrumentHandlerFunc                                      | 4.75%       | 100%        |          3 |     4 | github.com/prometheus/client_golang@v0.9.0/prometheus/http.go:172                                    |
| │       └─github.com/prometheus/client_golang/prometheus.InstrumentHandlerFuncWithOpts                            | 4.75%       | 100%        |          3 |     5 | github.com/prometheus/client_golang@v0.9.0/prometheus/http.go:242                                    |
| │         └─github.com/prometheus/client_golang/prometheus.NewSummary                                             | 4.75%       | 100%        |          3 |     6 | github.com/prometheus/client_golang@v0.9.0/prometheus/summary.go:171                                 |
| │           └─github.com/prometheus/client_golang/prometheus.newSummary                                           | 4.75%       | 100%        |          3 |     7 | github.com/prometheus/client_golang@v0.9.0/prometheus/summary.go:233                                 |
| │             └─github.com/prometheus/client_golang/prometheus.(*summary).newStream                               | 4.75%       | 100%        |          3 |     8 | github.com/prometheus/client_golang@v0.9.0/prometheus/summary.go:330                                 |
| │               └─github.com/beorn7/perks/quantile.NewTargeted                                                    | 4.75%       | 100%        |          3 |     9 | github.com/beorn7/perks@v0.0.0-20180321164747-3a771d992973/quantile/stream.go:101                    |
| │                 └─github.com/beorn7/perks/quantile.newStream                                                    | 4.75%       | 100%        |          3 |    10 | github.com/beorn7/perks@v0.0.0-20180321164747-3a771d992973/quantile/stream.go:133                    |
| └─github.com/pingcap/tidb/store/tikv.(*copIteratorWorker).run                                                     | 4.69%       | 4.69%       |          4 |     1 | github.com/pingcap/tidb@/store/tikv/coprocessor.go:452                                               |
|   └─github.com/pingcap/tidb/store/tikv.(*copIteratorWorker).handleTask                                            | 4.69%       | 100%        |          4 |     2 | github.com/pingcap/tidb@/store/tikv/coprocessor.go:624                                               |
|     └─github.com/pingcap/tidb/store/tikv.(*copIteratorWorker).handleTaskOnce                                      | 4.69%       | 100%        |          4 |     3 | github.com/pingcap/tidb@/store/tikv/coprocessor.go:660                                               |
|       └─github.com/pingcap/tidb/store/tikv.(*RegionRequestSender).SendReqCtx                                      | 4.69%       | 100%        |          4 |     4 | github.com/pingcap/tidb@/store/tikv/region_request.go:140                                            |
|         └─github.com/pingcap/tidb/store/tikv.(*RegionRequestSender).sendReqToRegion                               | 4.69%       | 100%        |          4 |     5 | github.com/pingcap/tidb@/store/tikv/region_request.go:170                                            |
|           └─github.com/pingcap/tidb/store/mockstore/mocktikv.(*RPCClient).SendRequest                             | 4.69%       | 100%        |          4 |     6 | github.com/pingcap/tidb@/store/mockstore/mocktikv/rpc.go:934                                         |
|             └─github.com/pingcap/tidb/store/mockstore/mocktikv.(*rpcHandler).handleCopDAGRequest                  | 4.69%       | 100%        |          4 |     7 | github.com/pingcap/tidb@/store/mockstore/mocktikv/cop_handler_dag.go:70                              |
|               └─github.com/pingcap/tidb/store/mockstore/mocktikv.(*indexScanExec).Next                            | 4.69%       | 100%        |          4 |     8 | github.com/pingcap/tidb@/store/mockstore/mocktikv/executor.go:341                                    |
|                 └─github.com/pingcap/tidb/store/mockstore/mocktikv.(*indexScanExec).getRowFromRange               | 4.69%       | 100%        |          4 |     9 | github.com/pingcap/tidb@/store/mockstore/mocktikv/executor.go:385                                    |
|                   └─github.com/pingcap/tidb/store/mockstore/mocktikv.(*MVCCLevelDB).Scan                          | 4.69%       | 100%        |          4 |    10 | github.com/pingcap/tidb@/store/mockstore/mocktikv/mvcc_leveldb.go:352                                |
|                     └─github.com/pingcap/tidb/store/mockstore/mocktikv.getValue                                   | 4.69%       | 100%        |          4 |    11 | github.com/pingcap/tidb@/store/mockstore/mocktikv/mvcc_leveldb.go:294                                |
|                       └─github.com/pingcap/tidb/store/mockstore/mocktikv.(*valueDecoder).Decode                   | 4.69%       | 100%        |          4 |    12 | github.com/pingcap/tidb@/store/mockstore/mocktikv/mvcc_leveldb.go:237                                |
|                         └─github.com/pingcap/tidb/store/mockstore/mocktikv.(*Iterator).Next                       | 4.69%       | 100%        |          4 |    13 | github.com/pingcap/tidb@/store/mockstore/mocktikv/mvcc_leveldb.go:138                                |
|                           └─github.com/pingcap/goleveldb/leveldb.(*dbIter).Next                                   | 4.69%       | 100%        |          4 |    14 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/db_iter.go:240               |
|                             └─github.com/pingcap/goleveldb/leveldb/iterator.(*mergedIterator).Next                | 4.69%       | 100%        |          4 |    15 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/iterator/merged_iter.go:169  |
|                               └─github.com/pingcap/goleveldb/leveldb/iterator.(*indexedIterator).Next             | 4.69%       | 100%        |          4 |    16 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/iterator/indexed_iter.go:149 |
|                                 └─github.com/pingcap/goleveldb/leveldb/iterator.(*indexedIterator).Next           | 4.69%       | 100%        |          4 |    17 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/iterator/indexed_iter.go:160 |
|                                   └─github.com/pingcap/goleveldb/leveldb/iterator.(*indexedIterator).setData      | 4.69%       | 100%        |          4 |    18 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/iterator/indexed_iter.go:39  |
|                                     └─github.com/pingcap/goleveldb/leveldb/table.(*indexIter).Get                 | 4.69%       | 100%        |          4 |    19 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/table/reader.go:507          |
|                                       └─github.com/pingcap/goleveldb/leveldb/table.(*Reader).getDataIterErr       | 4.69%       | 100%        |          4 |    20 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/table/reader.go:780          |
|                                         └─github.com/pingcap/goleveldb/leveldb/table.(*Reader).getDataIter        | 4.69%       | 100%        |          4 |    21 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/table/reader.go:769          |
|                                           └─github.com/pingcap/goleveldb/leveldb/table.(*Reader).newBlockIter     | 4.69%       | 100%        |          4 |    22 | github.com/pingcap/goleveldb@v0.0.0-20171020122428-b9ff6c35079e/leveldb/table/reader.go:736          |
+-------------------------------------------------------------------------------------------------------------------+-------------+-------------+------------+-------+------------------------------------------------------------------------------------------------------+
97 rows in set (0.09 sec)

And we can filter some leavies easily.

mysql> select * from performance_schema.tidb_profile_memory where depth < 5;
+------------------------------------------------------------------------------------+-------------+-------------+------------+-------+-------------------------------------------------------------------+
| FUNCTION                                                                           | PERCENT_ABS | PERCENT_REL | ROOT_CHILD | DEPTH | FILE                                                              |
+------------------------------------------------------------------------------------+-------------+-------------+------------+-------+-------------------------------------------------------------------+
| root                                                                               | 100%        | 100%        |          0 |     0 | root                                                              |
| ├─runtime.main                                                                     | 63.67%      | 63.67%      |          1 |     1 | runtime/proc.go:203                                               |
| │ ├─main.main                                                                      | 4.52%       | 7.09%       |          1 |     2 | github.com/pingcap/tidb@/tidb-server/main.go:177                  |
| │ │ └─main.createServer                                                            | 4.52%       | 100%        |          1 |     3 | github.com/pingcap/tidb@/tidb-server/main.go:555                  |
| │ │   └─github.com/pingcap/tidb/server.NewServer                                   | 4.52%       | 100%        |          1 |     4 | github.com/pingcap/tidb@/server/server.go:200                     |
| │ └─main.main                                                                      | 59.16%      | 92.91%      |          1 |     2 | github.com/pingcap/tidb@/tidb-server/main.go:176                  |
| │   ├─main.createStoreAndDomain                                                    | 40.53%      | 68.50%      |          1 |     3 | github.com/pingcap/tidb@/tidb-server/main.go:235                  |
| │   │ └─github.com/pingcap/tidb/store.New                                          | 40.53%      | 100%        |          1 |     4 | github.com/pingcap/tidb@/store/store.go:51                        |
| │   └─main.createStoreAndDomain                                                    | 18.63%      | 31.50%      |          1 |     3 | github.com/pingcap/tidb@/tidb-server/main.go:238                  |
| │     └─github.com/pingcap/tidb/session.BootstrapSession                           | 18.63%      | 100%        |          1 |     4 | github.com/pingcap/tidb@/session/session.go:1579                  |
| ├─runtime.main                                                                     | 22.83%      | 22.83%      |          2 |     1 | runtime/proc.go:190                                               |
| │ └─runtime.doInit                                                                 | 22.83%      | 100%        |          2 |     2 | runtime/proc.go:5217                                              |
| │   └─runtime.doInit                                                               | 22.83%      | 100%        |          2 |     3 | runtime/proc.go:5217                                              |
| │     ├─runtime.doInit                                                             | 4.48%       | 19.64%      |          2 |     4 | runtime/proc.go:5222                                              |
| │     └─runtime.doInit                                                             | 18.34%      | 80.36%      |          2 |     4 | runtime/proc.go:5217                                              |
| ├─github.com/pingcap/tidb/store/tikv.(*copIteratorWorker).run                      | 8.96%       | 8.96%       |          3 |     1 | github.com/pingcap/tidb@/store/tikv/coprocessor.go:452            |
| │ └─github.com/pingcap/tidb/store/tikv.(*copIteratorWorker).handleTask             | 8.96%       | 100%        |          3 |     2 | github.com/pingcap/tidb@/store/tikv/coprocessor.go:624            |
| │   └─github.com/pingcap/tidb/store/tikv.(*copIteratorWorker).handleTaskOnce       | 8.96%       | 100%        |          3 |     3 | github.com/pingcap/tidb@/store/tikv/coprocessor.go:660            |
| │     └─github.com/pingcap/tidb/store/tikv.(*RegionRequestSender).SendReqCtx       | 8.96%       | 100%        |          3 |     4 | github.com/pingcap/tidb@/store/tikv/region_request.go:140         |
| └─github.com/pingcap/tidb/server.(*Server).startHTTPServer                         | 4.53%       | 4.53%       |          4 |     1 | github.com/pingcap/tidb@/server/http_status.go:73                 |
|   └─github.com/prometheus/client_golang/prometheus.Handler                         | 4.53%       | 100%        |          4 |     2 | github.com/prometheus/client_golang@v0.9.0/prometheus/http.go:66  |
|     └─github.com/prometheus/client_golang/prometheus.InstrumentHandler             | 4.53%       | 100%        |          4 |     3 | github.com/prometheus/client_golang@v0.9.0/prometheus/http.go:162 |
|       └─github.com/prometheus/client_golang/prometheus.InstrumentHandlerFunc       | 4.53%       | 100%        |          4 |     4 | github.com/prometheus/client_golang@v0.9.0/prometheus/http.go:172 |
+------------------------------------------------------------------------------------+-------------+-------------+------------+-------+-------------------------------------------------------------------+

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

Code changes

  • Has exported function/method change

Related changes

  • Need to update the documentation

Release note

  • [feature] Support query cpu/memory/mutex/block/allocs/goroutines flamegraph by SQL.

…amegraph by SQL (#12986)

Signed-off-by: Lonng <heng@lonng.org>
Signed-off-by: Lonng <heng@lonng.org>
Signed-off-by: Lonng <heng@lonng.org>
Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@djshow832
Copy link
Contributor

Any conflicted files?

@lonng
Copy link
Contributor Author

lonng commented Oct 30, 2019

@djshow832 go.mod and planner/core/common_plans.go conflicts, but it's easy to resolve.

Copy link
Contributor

@djshow832 djshow832 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@djshow832 djshow832 added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. labels Oct 30, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Oct 30, 2019

Sorry @djshow832, you don't have permission to trigger auto merge event on this branch.

@winkyao winkyao added status/can-merge Indicates a PR has been approved by a committer. and removed status/can-merge Indicates a PR has been approved by a committer. labels Oct 30, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Oct 30, 2019

Your auto merge job has been accepted, waiting for 12950

@sre-bot
Copy link
Contributor

sre-bot commented Oct 30, 2019

/run-all-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants