mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 09:27:35 +00:00
LibWeb: Only generate ResourceLoader signposts while on Serenity
This commit is contained in:
parent
9e5480bcb5
commit
6027ab9e12
1 changed files with 9 additions and 1 deletions
|
@ -17,7 +17,10 @@
|
||||||
#include <LibWeb/Loader/ProxyMappings.h>
|
#include <LibWeb/Loader/ProxyMappings.h>
|
||||||
#include <LibWeb/Loader/Resource.h>
|
#include <LibWeb/Loader/Resource.h>
|
||||||
#include <LibWeb/Loader/ResourceLoader.h>
|
#include <LibWeb/Loader/ResourceLoader.h>
|
||||||
#include <serenity.h>
|
|
||||||
|
#ifdef __serenity__
|
||||||
|
# include <serenity.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Web {
|
namespace Web {
|
||||||
|
|
||||||
|
@ -99,8 +102,13 @@ static String sanitized_url_for_logging(AK::URL const& url)
|
||||||
|
|
||||||
static void emit_signpost(String const& message, int id)
|
static void emit_signpost(String const& message, int id)
|
||||||
{
|
{
|
||||||
|
#ifdef __serenity__
|
||||||
auto string_id = perf_register_string(message.characters(), message.length());
|
auto string_id = perf_register_string(message.characters(), message.length());
|
||||||
perf_event(PERF_EVENT_SIGNPOST, string_id, id);
|
perf_event(PERF_EVENT_SIGNPOST, string_id, id);
|
||||||
|
#else
|
||||||
|
(void)message;
|
||||||
|
(void)id;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t resource_id = 0;
|
static size_t resource_id = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue