Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4870)

Unified Diff: chrome_elf/dll_hash/dll_hash_main.cc

Issue 174013007: Add UMA stats to record when DLLs are successfully blocked in the Browser. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Better hashing Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_elf/dll_hash/dll_hash.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_elf/dll_hash/dll_hash_main.cc
diff --git a/chrome_elf/dll_hash/dll_hash_main.cc b/chrome_elf/dll_hash/dll_hash_main.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fe40c9a7e8097fda2d3bbd079576be0dcd4593b4
--- /dev/null
+++ b/chrome_elf/dll_hash/dll_hash_main.cc
@@ -0,0 +1,29 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// This is a utility executable used for generating hashes for dll names
+// for inclusion in tools/metrics/histograms/histograms.xml. Every
+// dll name must have a corresponding entry in the enum there.
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "chrome_elf/dll_hash_for_uma/dll_hash_for_uma.h"
+
+int main(int argc, char **argv) {
+ if (argc < 2) {
+ fprintf(stderr, "Usage: %s <dll name> <dll name> <...>\n", argv[0]);
+ fprintf(stderr, "\n");
+ fprintf(stderr, "Prints hashes for dll names.\n");
+ fprintf(stderr, "Example: %s \"my_dll.dll\" \"user32.dll\"\n",
+ argv[0]);
Alexei Svitkine (slow) 2014/02/26 14:32:14 Nit: fits on previous line? If not, indent 2 more.
csharp 2014/02/26 17:42:56 Done.
+ return 1;
+ }
+ for (int i = 1; i < argc; i++) {
+ int hash = DllNameToHash(std::string(argv[i]));
+ printf("<int value=\"%d\" label=\"%s\"/>\n", hash, argv[i]);
+ }
+ return 0;
+}
« no previous file with comments | « chrome_elf/dll_hash/dll_hash.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698