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

Side by Side Diff: src/trusted/validator/x86/ncval_reg_sfi/nc_opcode_histogram.h

Issue 625923004: Delete old x86 validator. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: rebase master Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2011 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7 /*
8 * Collects histogram information as a validator function.
9 *
10 * Note: The following functions are used to define a validator function
11 * for collecting this information. See header file ncvalidator_iter.h
12 * for more information on how to register these functions as a validator
13 * function.
14 */
15
16 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_REG_SFI_NC_OPCODE_HISTOGRA PH_H__
17 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_REG_SFI_NC_OPCODE_HISTOGRA PH_H__
18
19 #include "native_client/src/include/portability.h"
20 #include "native_client/src/shared/utils/types.h"
21
22 /* Defines a validator state. */
23 struct NaClValidatorState;
24
25 /* Defines an instruction iterator that processes a code segment. */
26 struct NaClInstIter;
27
28 /* Defines a data structure that holds data defining the opcode histogram
29 * being collected. Holds a histogram of the (first) byte of the found
30 * opcodes for each instruction.
31 */
32 typedef struct NaClOpcodeHistogram {
33 uint32_t opcode_histogram[256];
34 } NaClOpcodeHistogram;
35
36 /* Command line flag controlling whether an opcode histogram is
37 * collected while validating.
38 */
39 extern Bool NACL_FLAGS_opcode_histogram;
40
41 /* Initializes opcode histogram data in the validator state. */
42 void NaClOpcodeHistogramInitialize(struct NaClValidatorState* state);
43
44 /* Validator function to record histgram value for current instruction. */
45 void NaClOpcodeHistogramRecord(struct NaClValidatorState* state);
46
47 /* Validator print function to print out collected histogram. */
48 void NaClOpcodeHistogramPrintStats(struct NaClValidatorState* state);
49
50 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_REG_SFI_NC_OPCODE_HISTO GRAPH_H__ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698