login vsi company logo login vsi company logo 250x40
header-02.jpg

Troubleshooting with XPerf and Login VSI

Troubleshooting with XPerf and Login VSI

By integrating XPerf in a Login VSI workload, you can get valuable information to troubleshoot a problem in your environment. In a previous blog post I described how to integrate Process Monitor in a Login VSI workload. This can also be done with other tools like XPerf. In this blog post I will explain how to integrate XPerf in a Login VSI workload to troubleshoot an issue.

What is XPerf?

XPerf is a powerful tool that helps with overall system performance analysis. For more information I recommend to read this blog post.

Why is XPerf useful with Login VSI?

Login VSI simulates users on a virtual desktop infrastructure environment (VDI) or a remote desktop session host environment (RDSH/SBC). Because Login VSI has simple workload customization you can quickly create a workload with a specific application that contains a problem. For troubleshooting you can add XPerf to get to the bottom of what the application is doing while Login VSI is using the application. By reproducing you can apply changes and rerun the workload to verify if the problem is solved. Because Login VSI can integrate in a production environment you are able to troubleshoot on a single target machine during office hours.

Using XPerf with Login VSI

XPerf is part of the Windows Assessment and Deployment Kit and can be downloaded here. Run the ADKsetup and download the installers.

xperf assessment and deployment kitsetup

XPerf on the VSIshare

The best location to store the XPerf binaries is the VSIshare. We can use the default Login VSI mechanism to copy XPerf to your target machine.

NOTE: Running XPerf from the VSIshare is possible but not recommended.

When the installers are downloaded you can install the WPTx86-x86_en-us.msi or WPTx64-x86_en-us on a machine to install XPerf.

xperf wpt installers

Copy the files in the “C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit” directory. Probably not all files are required but I’m not sure which are so therefore I copied all files.

xperf wpt installed

To get XPerf on all the target machines we are going to create a directoy in the target libary. This way the files are copied when the Login VSI user logs on

Browse to the VSIshare and create a direcoty called XPerf in the following location: {VSIshare}\_VSI_Binaries\Target\Lib\

xperf lib

Paste the copied files.

xperf lib 2

Integration in the workload

XPerf is now copied on the target machine by the Login VSI logon script and can be used in the workload. In this example we are going to start XPerf, idle and stop the trace. Please use the command line reference for the correct trace.

In this example we are going to use the following command:

xperf -on DiagEasy+FILE_IO_INIT+REGISTRY

Because XPerf is not installed on the target machine we need to make sure the full path is used. The Login VSI command is as followed:

VSI_ShellExecute("XPerf", "%temp%\VSI\Runtime\Lib\Xperf\xperf.exe", "-on DiagEasy+FILE_IO_INIT+REGISTRY")

In this example we are going to idle for some amount of time. I’m using the Workload_Idle command which will display a message the XPerf trace is running.

Workload_Idle("XPerf", 600, "Running XPerf trace", 1)

Finally we are are going to stop the trace. In this example we are going to save the trace on the systemdrive in the Xperf directory. The file will contain the computer name so you can identify the trace file.

VSI_ShellExecute("XPerf", "%temp%\VSI\Runtime\Lib\Xperf\xperf.exe", "–d %systemdrive%\Xperf\%computername%-Xperf.etl")

After the trace is done the Login VSI user can logoff.

VSI_LogOff()

Running the workload

When starting a Login VSI test with the XPerf workload you will collect the Xperf date. This data can be used to troubleshoot a problem.

Complete XPerf workload:

#WLProp:Version#1.0.0
#WLProp:Date#2014-04-04
#WLProp:Description#The XPerf Workload
##### Start segment Prepare
Segment("Workload", "Prepare")
 
# Random wait before starting workload
Workload_RandomIdle("Workload", 5, %VSI_RandomInitialWait%, "Waiting to start workload")
 
# Set mouse position
VSI_Mouse_Position("Workload")
 
##############################################################
##### Start segment 1 - XPerf                        #####
##############################################################
Segment("Workload", 1)
 
# Start XPerf Trace
VSI_ShellExecute("XPerf", "%temp%\VSI\Runtime\Lib\Xperf\xperf.exe", "-on DiagEasy+FILE_IO_INIT+REGISTRY")
 
# XPerf Idle
Workload_Idle("XPerf", 600, "Running XPerf trace", 1)
 
# Stop XPerf Trace
VSI_ShellExecute("XPerf", "%temp%\VSI\Runtime\Lib\Xperf\xperf.exe", "–d %systemdrive%\Xperf\%computername%-Xperf.etl")
 
# Logoff action
VSI_LogOff()

Conclusion

The combination of Login VSI and XPerf is perfect to troubleshoot a specifc problem. With the easy workload customization of Login VSI you can reproduce the problem over and over again. This way you can apply changes and verify if the problem is solved. With the detailed information from XPerf you have valuable information to find the cause of the problem.

This blog was originally published on Logit Blog.

About the author

Ryan Bijkerk (@Logitblog) is a Product Owner at Login VSI and a Microsoft MVP on Application Virtualization (App-V) technology. He is also involved in the independent research Project VRC and speaks at events. Besides working, Ryan enjoys writing for his blog and riding his MTB.


Tags: How-to, Login VSI

Start Delivering the Best End User Experience Today

Request a Demo

Login VSI, Inc.

3945 Freedom Circle
Suite 670
Santa Clara, CA 95054

Phone: +1 408 899 7418

Login VSI B.V.

De Entree 85
1101 BH Amsterdam
The Netherlands

Phone: +31 20 705 1200