UTSASRG / Scaler

GNU General Public License v2.0
4 stars 0 forks source link

Test the percentage of outliers in measured data #85

Closed GammaPi closed 1 year ago

GammaPi commented 1 year ago

This experiment is requested by the professor.

The purpose is to test whether we can "precisely" remove scheduling overhead from the measured data and estimate the runtime of an API function without actually intercepting it. This will distinguish Scaler from Perf.

To complete this experiment, we need to do the following things:

  1. Measure the distribution of the runtime of APIs

    • Calculate an average first. Measure how many API invocation time fall into <1.5x average, 1.5 x average, 2 x average, 3 x average, 5 x average, 10 x average ,and >10 x average. Report this percentage on all APIs for all applications.
    • Select frequently invoked APIs, analyze whether this API can be skipped, and report the result to the professor.
  2. Evaluate the impact of scheduling on RDTSC meeasured runtime

    • Construct a simple example (eg: a+b) that has no scheduling.
    • Measure the difference between malloc and pthread_mutex_unlock. See the difference. Malloc is expected to have high variations of runtime. pthread_mutex_unlock is expected to have nearly constant runtime.
    • We may use bpftrace to verify whether scheduling has happened.
GammaPi commented 1 year ago

Outstanding APIs (Invocation Count)


The following analysis are based on "Bench Properties" tab in Scaler Matrix.xlsx.

APIs we may skip: pthread_spin_unlock, pthread_mutex_unlock, pthread_mutex_init, pthread_cond_init, pthread_mutex_unlock, pthread_mutex_trylock


[Blackscholes](): expf (libm), logf (libm), sqrtf(libm) account for 99.6% invocations.

[Bodytrack](): sqrt(libm), memset (libc), cosf (libm), sinf (libm), exp(libm), log (libm) account for 98.89% invocations.

[Canneal](): strcmp (libc), exp (libm), new (libc++), istream(libc++), locale(libc++), ioslc (libc++), memmove (libc) account for 94.56% invocations

Dedup: free (libc), malloc(libc), write(libc), pthread_spin_unlock(pthread), pthread_spin_lock(pthread), pthread_mutex_unlock(pthread), pthread_mutex_lock(pthread), memcpy (libc), memset (libc), pthread_mutex_init (pthread), memcmp (libc), pthread_cond_init (pthread) account for 95.43% invocations.

[Facesim](): sqrt (libm), sqrtf (libm), logf (libm), atan2(libm), sin (libm), cos (libm), powf (libm), account for 98.16%

[Ferret](): sqrt (libm), log(libm) account for 98.92%

[FluidAnimate](): pthread_mutex_unlock (pthread), pthread_mutex_lock (pthread), sqrtf (libm) account for 99.65%

[Freqmine](): getc (libc), feof (libc) account for 99.99%

Raytrace: sqrt (libm). strcmp (libXmu), peek (libXmy), sched_yield (libc), istream (libc++), locale (libc++), char_traits (libc++), sscanf (libc), getErc (libXmu) acccount for 95.32%

[StreamCluster](): irand48 (libm), pthread_mutex_trylock(pthread), account for 99%

[Swaptions](): exp (libm), log (libm) account for 97.22%

Vips: malloc (libc), free (libc), strcmp (libc) account for 94.76

[X264](): memcpy(libc), pthread_mutex_unlock (pthread), pthread_mutex_lock(pthread), free (libc), pthread_cond_broadcast (pthread) account for 95.78

httpd: tolower(libc), strlen(libc), apr_palloc (libapr), apr_file_gets (libapr), read (libc), close (libc), open (libc), account for 62.15%

memcached: pthread_mutex_lock (pthread), pthread_mutex_lock (pthread), read (libc), sendmsg (libc), clock_gettime(libc), epoll_wait(libc) account for 93.01%

mysql: memcpy(libc), memcmp(libc), memset(libc), pthread_self(libpthread), pthread_mutex_unlock (pthread), pthread_mutex_lock (pthread), malloc (libc) account for 77.5%

nginx: strcmp(libc), malloc(libc), strlen(libc), free(libc), pthread_rwlock_unlock(pthread), pthread_rwlock_wrlock(pthread), pthread_once(pthread), memset(libc) account for

Redis: memcpy (libc) account for 92.15%

[Sqlite](): memcmp (libc), memcpy (libc), strlen(libc) account for 99.07%

GammaPi commented 1 year ago

Time Outliers


The following analysis are based on "Outlier Removal Analysis" tab in Scaler Matrix.xlsx.


image

image

image

image

GammaPi commented 1 year ago

Time Plots

EXP

image

image

image

pthread_mutex_unlock

image

image

image

image

malloc

image

image

image

image

memcpy

image

image

image

image

fread

image