Skip to content

Instantly share code, notes, and snippets.

@Catfish-Man
Created November 17, 2015 21:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Catfish-Man/e53c4e38328446c59e51 to your computer and use it in GitHub Desktop.
Save Catfish-Man/e53c4e38328446c59e51 to your computer and use it in GitHub Desktop.
#!/usr/sbin/dtrace -q -s
/*
CFPreferencesServer$target:::request {
printf("REQUEST from pid %d at %Y ( domain: %s, user: %s, host: %s, container: %s, managed: %d)\n",
arg0,
walltimestamp,
arg1 != NULL ? copyinstr(arg1) : "(NULL)",
arg2 != NULL ? copyinstr(arg2) : "(NULL)",
arg3 != NULL ? copyinstr(arg3) : "(NULL)",
arg4 != NULL ? copyinstr(arg4) : "(NULL)",
arg5);
}*/
CFPreferencesServer$target:::write_rejected {
printf("REJECTED WRITE OF KEY %s from pid %d for reason %s at %Y ( domain: %s, user: %s, host: %s, container: %s)\n",
arg1 != NULL ? copyinstr(arg1) : "(No Key)",
arg0,
arg6 != NULL ? copyinstr(arg6) : "(NULL)",
walltimestamp,
arg2 != NULL ? copyinstr(arg2) : "(NULL)",
arg3 != NULL ? copyinstr(arg3) : "(NULL)",
arg4 != NULL ? copyinstr(arg4) : "(NULL)",
arg5 != NULL ? copyinstr(arg5) : "(NULL)");
}
CFPreferencesServer$target:::write {
printf("ACCEPTED WRITE OF KEY %s from pid %d at %Y ( domain: %s, user: %s, host: %s, container: %s)\n",
arg1 != NULL ? copyinstr(arg1) : "(No Key)",
arg0,
walltimestamp,
arg2 != NULL ? copyinstr(arg2) : "(NULL)",
arg3 != NULL ? copyinstr(arg3) : "(NULL)",
arg4 != NULL ? copyinstr(arg4) : "(NULL)",
arg5 != NULL ? copyinstr(arg5) : "(NULL)");
}
/*
CFPreferencesServer$target:::cache_miss {
printf("CACHE MISS from pid %d at %Y ( domain: %s, user: %s, host: %s, container: %s, managed: %d)\n", arg0, walltimestamp, copyinstr(arg1) != NULL ? copyinstr(arg1) : "(NULL)", copyinstr(arg2) != NULL ? copyinstr(arg2) : "(NULL)", copyinstr(arg3) != NULL ? copyinstr(arg3) : "(NULL)", copyinstr(arg4) != NULL ? copyinstr(arg4) : "(NULL)", arg5);
}
*/
CFPreferencesServer$target:::read_rejected {
printf("REJECTED READ request from pid %d for reason %s at %Y ( domain: %s, user: %s, host: %s, container: %s, managed: %d)\n", arg0, copyinstr(arg6) != NULL ? copyinstr(arg6) : "(NULL)", walltimestamp, copyinstr(arg1) != NULL ? copyinstr(arg1) : "(NULL)", copyinstr(arg2) != NULL ? copyinstr(arg2) : "(NULL)", copyinstr(arg3) != NULL ? copyinstr(arg3) : "(NULL)", copyinstr(arg4) != NULL ? copyinstr(arg4) : "(NULL)", arg5);
}
CFPreferencesServer$target:::read {
printf("ACCEPTED READ from pid %d at %Y ( domain: %s, user: %s, host: %s, container: %s, managed: %d)\n", arg0, walltimestamp, copyinstr(arg1) != NULL ? copyinstr(arg1) : "(NULL)", copyinstr(arg2) != NULL ? copyinstr(arg2) : "(NULL)", copyinstr(arg3) != NULL ? copyinstr(arg3) : "(NULL)", copyinstr(arg4) != NULL ? copyinstr(arg4) : "(NULL)", arg5);
}
CFPreferencesServer$target:::persist {
printf("SAVING %s TO DISK at %Y\n", copyinstr(arg0) != NULL ? copyinstr(arg0) : "(NULL)", walltimestamp);
}
CFPreferencesServer$target:::error {
printf("ERROR %s at %Y\n", copyinstr(arg0) != NULL ? copyinstr(arg0) : "(NULL)", walltimestamp);
}
BEGIN
{
printf("Monitoring cfprefsd instance %d\n\n", $target);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment