Skip to content

Instantly share code, notes, and snippets.

View wmealing's full-sized avatar
💭
Take me home, country roads

Wade Mealing wmealing

💭
Take me home, country roads
  • Brisbane
View GitHub Profile
@wmealing
wmealing / bad router.
Created February 9, 2013 13:11
Something i'm working on debugging, multiple handlers inside a cowboy route.
cowboy_router:compile([
{'_', [
{[<<"index">>], cowboy_http_static, [{file}, <<"index.html">>]},
{'_', another_handler, []}
]}
]).
dispatch_rules() ->
%% {Host, list({Path, Handler, Opts})}
{'_', [
{[], cowboy_static, [<<"index.html">>] }
]
}.
@wmealing
wmealing / gist:5316542
Last active December 15, 2015 20:09
Why your xen migration is throwing an error message: Clocksource tsc unstable (delta = 125002555 ns). Enable clocksource failover by adding clocksource_failover kernel parameter.

After migrating a guess to a similar (but not the same CPU) the messages appear in the logs:

    Clocksource tsc unstable (delta = 125002555 ns).  Enable clocksource failover by adding clocksource_failover kernel parameter.

The kernel attempts to keep some kind of consistency in regards to clock migration, the underlying hardware watchdog seems to iterate through all of the available watchdogs/clocks. I don't know if you know how to read code, so I'll attempt to explain what is happening

The kernel implements some kind of clock watchdog to ensure clock sanity for process accounting and that the clock behavior is generally consistent.

My comments relevant to the discussion are in these style delimiters */ */ , and this is a modified version of the source code cut back for easier understanding.

Joined with thread 1; time elapsed was 23920
Joined with thread 2; returned value was 2
Joined with thread 2; time elapsed was 148642
Joined with thread 3; returned value was 3
Joined with thread 3; time elapsed was 228314
Thread num: 12 | sched_setscheduler(): 0
Joined with thread 4; returned value was 4
Joined with thread 4; time elapsed was 141420
Thread num: 12 | get_tsc(): 12993971038190260
....................................................................................................Joined with thread 5; returned value was 5
/* -------------------------------------------------------------------------
* Semaphore timing test.
*
* gcc -m64 -g -O3 -lm -o sema-test sema-test.c
*
* Based on schedulertest
* Version 1.
------------------------------------------------------------------------- */
#include <math.h>
rebar eunit -v
==> plugin_manager (eunit)
:18: syntax error before: '}'
Not so useful
/* -------------------------------------------------------------------------
* Semaphore timing test.
*
* gcc -m64 -g -O3 -lm -o sema-test sema-test.c
*
* Based on schedulertest
* Version 1.
------------------------------------------------------------------------- */
#include <math.h>
======================== EUnit ========================
module 'plugin_manager_sup'
module 'plugin_manager_sup_tests'
plugin_manager_sup_tests:17: worker_is_started (Supervisor plugin_manager_srv is started)...ok
plugin_manager_sup_tests:17: worker_is_started (Supervisor plugin_event_manager is started)...ok
[done in 0.006 s]
[done in 0.006 s]
module 'plugin_manager_srv'
module 'plugin_manager_srv_tests'
plugin_manager_srv_tests: add_plugin_test...ok
cd /home/danderso
cp /etc/skel/.* /etc/skel/* .
chown -R danderso:danderso .
chmod -R go=u,go-w .
chmod go= .
Source Summary
Total: 79%
Module Coverage %
plugin_event_manager 33%
plugin_manager 100%
plugin_manager_app 50%
plugin_manager_srv 80%
plugin_manager_sup 100%