Commit Graph

12 Commits

Author SHA1 Message Date
louei5 6f82ec5fc9 fix pclint & codecheck warnings 2021-05-29 09:41:40 +08:00
luopengting 786eb319a1 fix ci warning:
1. Use 'const' for member functions that do not modify member variables
2. Use the 'override' keyword when overriding virtual functions
2021-05-11 09:26:50 +08:00
luopengting 7feb309e06 add '/' when the MS_RDR_PATH does not end with '/' 2021-05-09 08:39:13 +08:00
dingpeifei 8d830f1e5c Memory reuse switch 2021-04-15 14:33:44 +08:00
luopengting 727dc08bfa fix TAINTED_SCALAR and capitalize constants
1. fix the tainted variable 'path'
2. capitalize constants in env_config_parser
3. move constants about attribute to common utils.h
2021-04-08 14:22:12 +08:00
luopengting facff39ff8 fix codedex in RDR
1. check whether path is empty in IsEveryFilenameValid().
2. do not print the string in IsStrLengthValid(), it's not safe.
3. make the constants about hash in recorder_manager.h.
4. initialize some variables.
2021-04-02 14:39:14 +08:00
luopengting 23ba47df6c add MS_RDR_ENABLE and MS_RDR_PATH
MS_RDR_ENABLE should be in {0, 1}. if it is set as other value, it will
be 0 and WARNING information will be printed to tell user.
The settings in config file set by the user takes precedence over the
environment variables. If 'rdr_enable' is 0 in environment variable,
and then 'enable' is true in config file, the RDR will turned on.
2021-03-18 15:48:59 +08:00
luopengting 027edbb679 fix rdr log when env_config_path is empty 2021-03-09 17:32:06 +08:00
luopengting 7914363d25 optimize rdr mainly to reduce the redundant code
1. move common function to base recorder
2. add UpdataRdrEnable() for recorder manager, and update once
3. add delimiter virable for base recorder, set it as '.'
4. modify recorders to use the suffix parameter of GetFileRealPath()
5. improve the text in ms_context

Can not add RdrEnablePlatform because linux is supported only.
If os is linux, (!is_rdr_supported && rdr_enable) will be false always,
else, (is_rdr_supported && !rdr_enable) will be false always.
2021-03-01 09:32:57 +08:00
luopengting b4d56f6358 add functions to check for directory and filename
1. add validation for directory and filename
2. refactor the file operations about path
3. add in CMakeLists
4. add logger in nn_ops
2021-02-08 11:50:02 +08:00
luopengting cf52522cce fix env_config_parser when json key does not exist 2021-01-30 17:38:23 +08:00
luopengting 4683ecc06b support env_config_path to set the config file for DFX
1. add env_config_path for ms_context
2. add EnvConfigParser to parse config
3. add in CMakeLists
4. clang-format, cpplint
5. fix spelling in ms_context

Use EnvConfigParser in the constructed function of base_recorder,
when a recorder is initialized, its direcctory will be set as the
value from config file. In addition, recorder_manager will get the
'enable' from config file. If 'enable' is true and the path is not a
valid value, it will be the default value: './rdr'.
2021-01-28 15:10:23 +08:00