Next: , Previous: Test Interference API, Up: Test Interference API


12.3.1 ti_start_interference

Function that creates test interference "instance" and starts the interference process. By "instance" we understand testInterference structure. Pointer to this structure is returned by ti_start_interference function, and is used for manipulating created interference process (pausing/resuming and stopping). When function returns, test interference process is started. As argument, function takes enumerator TInterferenceType, and value of load. TinterferenceType enumerator has the following values:

     typedef enum {
             ECpuLoad,
             EMemLoad,
             EIOLoad
     } TInterferenceType;

Enumerator (along with all test interference functions) is available if file includes the header min_test_interference.h. Function has the following prototype:

     testInterference *ti_start_interference (TInterferenceType aType,
                                                    int aLoadValue
                                                   );

and should be used in following way:

     testInterference* disturbance;
     disturbance = ti_start_interference(ECpuLoad, 75);

In case of EcpuLoad, load value holds amount of CPU time that should be taken, in percent. In case of EmemLoad, aLoadValue holds amount of memory to be taken, in megabytes. In case of IOLoad (which performs disk IO operations), this value is ignored. It should be also noted, that if it is not possible to create test interference (for any reason, including missing sp-stress package), function will return NULL. More detailed problem information can then be found in syslog.