File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -144,10 +144,16 @@ bool PyProfile::remove(std::string profile)
144
144
}
145
145
146
146
// -------------------------------------------------------------------------------------
147
- void PyProfile::print_stats (const std::string& sort = " time " )
147
+ void PyProfile::print_stats (const std::string& sort, const std::string& profileName )
148
148
{
149
+ PyProfile::PROFILES::iterator iter = profiles_.find (profileName.c_str ());
150
+ if (iter == profiles_.end ())
151
+ {
152
+ return ;
153
+ }
154
+
149
155
PyObject* pyRet = PyObject_CallMethod (iter->second .get (), const_cast <char *>(" print_stats" ),
150
- const_cast <char *>(" s" ), const_cast <char *>(" time " ));
156
+ const_cast <char *>(" s" ), const_cast <char *>(sort. c_str () ));
151
157
152
158
if (pyRet)
153
159
Py_DECREF (pyRet);
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ class PyProfile
44
44
static void addToStream (std::string profile, MemoryStream* s);
45
45
static bool remove (std::string profile);
46
46
47
- static void print_stats (const std::string& sort = " time" );
47
+ static void print_stats (const std::string& sort = " time" , const std::string& profileName = " kbengine " );
48
48
49
49
/* *
50
50
初始化pickler
You can’t perform that action at this time.
0 commit comments