Creating a False Sharing Analysis Task
Function
False sharing analysis is based on the Arm SPE capability. SPE samples instructions and records information about triggered events, including accurate PC pointer information. By using SPE for false sharing analysis on services, the tool obtains information about the number and proportion of false sharing times, instruction addresses, code line numbers, and NUMA nodes. Based on the information, you can modify your programs to reduce the probability of false sharing and improve performance.
Prerequisites
- No nodes are in the Offline state.
- The OS must support perf c2c and the kernel version must be 4.19 or later. The SPE environment has been configured. For details, see Configuring the SPE Environment.
- False sharing analysis is not supported in the VM environment.
Procedure
- Click
next to System Profiler.Choose General Analysis from the drop-down list. The page for creating a task is displayed.
- Set task parameters by referring to "Task Management" and Table 1.Create a false sharing analysis task. See Figure 1.
Table 1 Parameters for creating a false sharing analysis task Parameter
Description
Task Name
Name of the task. The name must meet the following requirements:
- Contain only letters, digits, and underscores (_).
- Contain 1 to 64 characters.
Select Nodes
Select the nodes to be analyzed. If there is only one node, this node is selected by default. A maximum of 10 nodes can be selected at a time.
Analysis Object
Select System or Application.
Mode
Select Launch application or Attach to process.
This parameter is mandatory when Analysis Object is set to Application.
Application Path
Enter the absolute path of the application to be analyzed. For example, to analyze the loop_test application stored in the /home/test directory, enter /home/test/loop_test.
This parameter is mandatory when Analysis Object is set to Application and Mode is set to Launch application.
NOTE:- By default, applications in the /opt/ or /home/ directory are analyzed. The administrator can click
in the upper right corner on the home page and choose Tool Settings > System Profiler > System Settings, and enter application paths (separated by semicolons) in the Application Path text box. Only administrators can modify this parameter. Common users can only view this parameter.
You are advised to set the application path to a path such as /home or /opt. Do not set the application path to a system directory such as /, /dev, /sys, or /boot. Otherwise, system exceptions may occur.
- The OS running user (devkitworker1) of the System Profiler must have the read and execute permissions on the applications to be analyzed.
- In the multi-node scenario, you can enable Configure Node Parameters to configure this parameter separately for each node.
(Optional) Application Parameters
Set application parameters based on the actual scenario.
This parameter is available when Analysis Object is set to Application and Mode is set to Launch application.
NOTE:You can enable Configure Node Parameters to configure this parameter separately for each node.
(Optional) Application User
Information about the OS user who runs the application. The application runs under the preset devkitworker1 user by default. If the application only runs under a specific user, enable the option, configure the corresponding user name and password, and then run the application.
This parameter is available when Mode is set to Launch application. By default, this parameter is disabled.
Name
Name of the OS user who runs the application.
This parameter is mandatory when Application User is enabled.
Password
User password.
This parameter is mandatory when Application User is enabled.
Process
Enter a process name. The process name can be a regular expression.
This parameter is mandatory when Analysis Object is set to Application and Mode is set to Attach to process.
(Optional) PID
Enter a maximum of 128 PIDs of the processes to be analyzed. Use commas (,) to separate the PIDs. PID and Process can be configured together.
This parameter is available when Analysis Object is set to Application and Mode is set to Attach to process.
NOTE:- If Attach to process is selected, the tool associates the ID of the process that runs an application to trace and collect the performance data of the application in real time. The OS running user devkitworker1 of the System Profiler must have the read permission on the application.
- To query the PID, run the ps -ef | grep Program_name command.
- You can enable Configure Node Parameters to configure this parameter separately for each node.
Analysis Type
Select Memory Access.
Access Analysis Type
Select False sharing.
Sampling Duration (s)
Sampling duration, in seconds. The default value is 3. The value range is 1 to 10.
NOTE:The recommended sampling duration is 3, 5, or 10 seconds. A long sampling duration may result in a large amount of collected data and long analysis time. In addition, the data collected may be data of cache line access in staggered time rather than that of concurrent false sharing access.
Sampling Interval (Instructions)
Sampling interval. The default value is 1024. The value range is 1024 to 232 – 1. This parameter needs to be set in Advanced Configurations.
NOTE:You can increase the sampling interval to reduce the amount of data to be sampled. However, a long sampling interval also reduces the number of sampling points.
(Optional) Sampling Delay (s)
Sampling delay, in seconds. The default value is 0. The value range is 0 to 900. This parameter can be set in Advanced Configurations.
NOTE:The sampling starts after the specified time. This parameter is used to ignore the program startup analysis, warm up the sampling program, and eliminate sampling delay caused by factors such as environment detection.
(Optional) CPU Cores to Be Sampled
IDs of the CPU cores to be sampled. This parameter can be set in Advanced Configurations.
NOTE:- Set this parameter if you want to collect the performance data of an application on a CPU core. Enter one or more CPU core IDs here. The value range is 0 to the total number of CPU cores of the server minus 1. For example, if you enter 0,1,2,10 for a 16-core CPU, performance data of CPU cores 0, 1, 2, and 10 will be collected and analyzed.
- If the IDs of the CPU cores where the application thread is running are known, you can set this parameter to reduce the sampled data.
- You can enable Configure Node Parameters to configure this parameter separately for each node.
(Optional) Sampling Range
Sampling range. The default value is User Mode. This parameter can be set in Advanced Configurations. The options are:
- All: collects performance data of the application layer and OS kernel.
- User Mode: collects performance data of the application layer.
- Kernel Mode: collects performance data of the OS kernel.
NOTE:If only user-mode programs are analyzed, you are advised to select User Mode.
(Optional) Symbol File Path
Absolute path of the symbol file on the server. This parameter can be set in Advanced Configurations.
NOTE:- You can use this parameter to import the symbol table of an application when you need to view the performance data after source code and assembly instructions are mapped but the corresponding application has no symbol table information.
- You can enable Configure Node Parameters to configure this parameter separately for each node.
(Optional) C/C++ Source File Path
Absolute path of the C/C++ source file on the server. This parameter can be set in Advanced Configurations.
NOTICE:The source code of the application must comply with the general programming specifications. Otherwise, the source code of hot functions in the analysis result may not be displayed properly.
NOTE:- You can use this parameter to import the source code of an application to view the performance data after the source code and assembly instructions are mapped.
- You can enable Configure Node Parameters to configure this parameter separately for each node.
(Optional) Associate Kernel Function with Assembly Code
Indicates whether to associate kernel functions with assembly instructions. This parameter is disabled by default. This parameter can be set in Advanced Configurations.
(Optional) Size of the Collected File (MiB)
Size of the file to be collected. The default value is 10. The value range is 1 to 1,024. This parameter can be set in Advanced Configurations.
NOTE:You can set the size of the file to be collected to prevent long analysis time caused by large file size.
Task Execution
The options are Execute now (default) and On a schedule. You need to set this parameter in Advanced Configurations.
If On a schedule is selected, you need to set Sampling Mode, Sampling Time, and Sampling Date.
For Periodical sampling mode, the task runs once a day in the sampling period. You need to set Sampling Time and Sampling Date.
For One-Time sampling mode, the task takes effect only once. You need to set Sampling Date and Time.
NOTE:- A user can create a maximum of 20 scheduled tasks.
- You can click
in the upper right corner of the page, choose Tool Settings > System Profiler, and click the Scheduled Tasks tab to view, edit, or delete (batch deletion supported) the created scheduled tasks. - The Restart button is unavailable for scheduled tasks.
- Click OK.
You can click the icons next to the task name to perform the following operations:
: stops an analysis task. After an analysis task is stopped, the collected information will be deleted.
: restarts an analysis task. You can modify task parameter settings and restart an analysis task. This button is available when a task is canceled or fails.
: deletes an analysis task. After a task is deleted, all data of this task will be deleted. Exercise caution when performing this operation.
: performs an analysis again. The analysis task is renamed and restarted.
: creates a task for comparing analysis results.
: modifies the task or report name. The report naming rule is the same as that of a task.
