Skip to content

Commit 4172439

Browse files
committed
tests/capi: omit sysprof testing
The commit d72e40f ("tests: enable sysprof in luaL_loadbuffer_proto") added sysprof support to the luaL_loadbuffer_proto_test. With test misc_sysprof_test.lua added in the previous commit sysprof in luaL_loadbuffer_proto_test is not needed anymore. The patch removes it.
1 parent abd7883 commit 4172439

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

tests/capi/luaL_loadbuffer_proto/luaL_loadbuffer_proto_test.cc

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,6 @@ metrics_increment_num_error_samples(struct metrics *metrics)
180180
metrics->total_num_with_errors++;
181181
}
182182

183-
UNUSED static void
184-
profiler_cb(lua_State *L, void *data, int samples, int vmstate)
185-
{
186-
(void)L;
187-
(void)data;
188-
/* Do nothing. */
189-
}
190-
191183
/**
192184
* Get an error message from the stack, and report it to std::cerr.
193185
* Remove the message from the stack.
@@ -355,31 +347,6 @@ DEFINE_PROTO_FUZZER(const lua_grammar::Block &message)
355347
luaL_dostring(L, "jit.opt.start('hotexit=1')");
356348
luaL_dostring(L, "jit.opt.start('recunroll=1')");
357349
luaL_dostring(L, "jit.opt.start('callunroll=1')");
358-
359-
/*
360-
* The `mode` argument is a string holding options:
361-
* f - Profile with precision down to the function level.
362-
* l - Profile with precision down to the line level.
363-
* i<number> - Sampling interval in milliseconds (default 10ms).
364-
*/
365-
char mode[] = "fli15";
366-
size_t depth = 5;
367-
int len = 5;
368-
369-
/* Start profiler. */
370-
luaJIT_profile_start(L, mode, (luaJIT_profile_callback)profiler_cb, NULL);
371-
372-
/*
373-
* Function allows taking stack dumps in an efficient manner, returns a
374-
* string with a stack dump for the thread (coroutine), formatted according
375-
* to the fmt argument:
376-
* p - Preserve the full path for module names.
377-
* f - Dump the function name if it can be derived.
378-
* F - Ditto, but dump module:name.
379-
* l - Dump module:line.
380-
* Z - Zap the following characters for the last dumped frame.
381-
*/
382-
luaJIT_profile_dumpstack(L, "pfFlz", len, &depth);
383350
#endif /* LUAJIT */
384351

385352
if (luaL_loadbuffer(L, code.c_str(), code.size(), "fuzz") != LUA_OK) {
@@ -416,8 +383,6 @@ DEFINE_PROTO_FUZZER(const lua_grammar::Block &message)
416383
lua_sethook(L, Hook, 0, count);
417384
#ifdef LUAJIT
418385
disable_lj_metrics(L, &metrics);
419-
/* Stop profiler. */
420-
luaJIT_profile_stop(L);
421386
#endif /* LUAJIT */
422387

423388
lua_settop(L, 0);

0 commit comments

Comments
 (0)