Skip to content

Commit

Permalink
Bug 1360471 (part 3) - Rename various "thread name filters" identifie…
Browse files Browse the repository at this point in the history
…rs as "filters". r=mstange.

The new names are more concise and matches common usage elsewhere (e.g.
profiler_start() arguments).

This patch is similar to bug 1358074 part 5.
  • Loading branch information
nnethercote committed May 1, 2017
1 parent ebe44f1 commit cc78872
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 32 deletions.
9 changes: 4 additions & 5 deletions dom/ipc/ContentChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2575,15 +2575,14 @@ ContentChild::RecvStartProfiler(const ProfilerInitParams& params)
featureArray.AppendElement(params.features()[i].get());
}

nsTArray<const char*> threadNameFilterArray;
for (size_t i = 0; i < params.threadFilters().Length(); ++i) {
threadNameFilterArray.AppendElement(params.threadFilters()[i].get());
nsTArray<const char*> filterArray;
for (size_t i = 0; i < params.filters().Length(); ++i) {
filterArray.AppendElement(params.filters()[i].get());
}

profiler_start(params.entries(), params.interval(),
featureArray.Elements(), featureArray.Length(),
threadNameFilterArray.Elements(),
threadNameFilterArray.Length());
filterArray.Elements(), filterArray.Length());

return IPC_OK();
}
Expand Down
8 changes: 4 additions & 4 deletions dom/plugins/ipc/PluginModuleChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2664,14 +2664,14 @@ PluginModuleChild::RecvStartProfiler(const ProfilerInitParams& params)
featureArray.AppendElement(params.features()[i].get());
}

nsTArray<const char*> threadNameFilterArray;
for (size_t i = 0; i < params.threadFilters().Length(); ++i) {
threadNameFilterArray.AppendElement(params.threadFilters()[i].get());
nsTArray<const char*> filterArray;
for (size_t i = 0; i < params.filters().Length(); ++i) {
filterArray.AppendElement(params.filters()[i].get());
}

profiler_start(params.entries(), params.interval(),
featureArray.Elements(), featureArray.Length(),
threadNameFilterArray.Elements(), threadNameFilterArray.Length());
filterArray.Elements(), filterArray.Length());

return IPC_OK();
}
Expand Down
9 changes: 4 additions & 5 deletions gfx/ipc/GPUParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,14 +394,13 @@ GPUParent::RecvStartProfiler(const ProfilerInitParams& params)
featureArray.AppendElement(params.features()[i].get());
}

nsTArray<const char*> threadNameFilterArray;
for (size_t i = 0; i < params.threadFilters().Length(); ++i) {
threadNameFilterArray.AppendElement(params.threadFilters()[i].get());
nsTArray<const char*> filterArray;
for (size_t i = 0; i < params.filters().Length(); ++i) {
filterArray.AppendElement(params.filters()[i].get());
}
profiler_start(params.entries(), params.interval(),
featureArray.Elements(), featureArray.Length(),
threadNameFilterArray.Elements(),
threadNameFilterArray.Length());
filterArray.Elements(), filterArray.Length());

return IPC_OK();
}
Expand Down
6 changes: 3 additions & 3 deletions tools/profiler/core/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2065,7 +2065,7 @@ profiler_init(void* aStackTop)
, "threads"
};

const char* threadFilters[] = { "GeckoMain", "Compositor" };
const char* filters[] = { "GeckoMain", "Compositor" };

if (getenv("MOZ_PROFILER_HELP")) {
PrintUsageThenExit(0); // terminates execution
Expand Down Expand Up @@ -2131,14 +2131,14 @@ profiler_init(void* aStackTop)

locked_profiler_start(lock, entries, interval,
features, MOZ_ARRAY_LENGTH(features),
threadFilters, MOZ_ARRAY_LENGTH(threadFilters));
filters, MOZ_ARRAY_LENGTH(filters));
}

// We do this with gPSMutex unlocked. The comment in profiler_stop() explains
// why.
NotifyProfilerStarted(PROFILER_DEFAULT_ENTRIES, PROFILER_DEFAULT_INTERVAL,
features, MOZ_ARRAY_LENGTH(features),
threadFilters, MOZ_ARRAY_LENGTH(threadFilters));
filters, MOZ_ARRAY_LENGTH(filters));
}

static void
Expand Down
2 changes: 1 addition & 1 deletion tools/profiler/gecko/CrossProcessProfilerController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ CrossProcessProfilerController::StartProfiler(nsIProfilerStartParams* aParams)
aParams->GetEntries(&ipcParams.entries());
aParams->GetInterval(&ipcParams.interval());
ipcParams.features() = aParams->GetFeatures();
ipcParams.threadFilters() = aParams->GetThreadFilterNames();
ipcParams.filters() = aParams->GetFilters();

mProcess->SendStartProfiler(ipcParams);
}
Expand Down
4 changes: 2 additions & 2 deletions tools/profiler/gecko/ProfilerTypes.ipdlh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ struct ProfilerInitParams {
bool enabled;
uint32_t entries;
double interval;
nsCString[] threadFilters;
nsCString[] filters;
nsCString[] features;
};

} // namespace mozilla
} // namespace mozilla
4 changes: 2 additions & 2 deletions tools/profiler/gecko/nsIProfiler.idl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface nsIProfilerStartParams : nsISupports
readonly attribute double interval;

[noscript, notxpcom, nostdcall] StringArrayRef getFeatures();
[noscript, notxpcom, nostdcall] StringArrayRef getThreadFilterNames();
[noscript, notxpcom, nostdcall] StringArrayRef getFilters();
};

[scriptable, uuid(ead3f75c-0e0e-4fbb-901c-1e5392ef5b2a)]
Expand All @@ -34,7 +34,7 @@ interface nsIProfiler : nsISupports
void StartProfiler(in uint32_t aEntries, in double aInterval,
[array, size_is(aFeatureCount)] in string aFeatures,
in uint32_t aFeatureCount,
[array, size_is(aFilterCount), optional] in string aThreadNameFilters,
[array, size_is(aFilterCount), optional] in string aFilters,
[optional] in uint32_t aFilterCount);
void StopProfiler();
boolean IsPaused();
Expand Down
5 changes: 2 additions & 3 deletions tools/profiler/gecko/nsProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,14 @@ nsProfiler::CanProfile(bool *aCanProfile)
NS_IMETHODIMP
nsProfiler::StartProfiler(uint32_t aEntries, double aInterval,
const char** aFeatures, uint32_t aFeatureCount,
const char** aThreadNameFilters, uint32_t aFilterCount)
const char** aFilters, uint32_t aFilterCount)
{
if (mLockedForPrivateBrowsing) {
return NS_ERROR_NOT_AVAILABLE;
}

profiler_start(aEntries, aInterval,
aFeatures, aFeatureCount,
aThreadNameFilters, aFilterCount);
aFeatures, aFeatureCount, aFilters, aFilterCount);

// Do this after profiler_start().
mGatherer = new ProfileGatherer();
Expand Down
8 changes: 4 additions & 4 deletions tools/profiler/gecko/nsProfilerStartParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ NS_IMPL_ISUPPORTS(nsProfilerStartParams, nsIProfilerStartParams)
nsProfilerStartParams::nsProfilerStartParams(uint32_t aEntries,
double aInterval,
const nsTArray<nsCString>& aFeatures,
const nsTArray<nsCString>& aThreadFilterNames) :
const nsTArray<nsCString>& aFilters) :
mEntries(aEntries),
mInterval(aInterval),
mFeatures(aFeatures),
mThreadFilterNames(aThreadFilterNames)
mFilters(aFilters)
{
}

Expand Down Expand Up @@ -45,7 +45,7 @@ nsProfilerStartParams::GetFeatures()
}

const nsTArray<nsCString>&
nsProfilerStartParams::GetThreadFilterNames()
nsProfilerStartParams::GetFilters()
{
return mThreadFilterNames;
return mFilters;
}
4 changes: 2 additions & 2 deletions tools/profiler/gecko/nsProfilerStartParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ class nsProfilerStartParams : public nsIProfilerStartParams
nsProfilerStartParams(uint32_t aEntries,
double aInterval,
const nsTArray<nsCString>& aFeatures,
const nsTArray<nsCString>& aThreadFilterNames);
const nsTArray<nsCString>& aFilters);

private:
virtual ~nsProfilerStartParams();
uint32_t mEntries;
double mInterval;
nsTArray<nsCString> mFeatures;
nsTArray<nsCString> mThreadFilterNames;
nsTArray<nsCString> mFilters;
};

#endif
2 changes: 1 addition & 1 deletion tools/profiler/public/GeckoProfiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ PROFILER_FUNC_VOID(profiler_shutdown())
PROFILER_FUNC_VOID(profiler_start(int aEntries, double aInterval,
const char** aFeatures,
uint32_t aFeatureCount,
const char** aThreadNameFilters,
const char** aFilters,
uint32_t aFilterCount))

// Stop the profiler and discard the profile without saving it. A no-op if the
Expand Down

0 comments on commit cc78872

Please sign in to comment.