function [] = plotres( filename )
% plots canethgw benchmark data
data = dlmread( filename );

figure;
hold on;
semilogy( data(1,:), "r" );
semilogy( data(2,:), "g" );
semilogy( data(3,:), "b" );
semilogy( data(4,:), "m" );
axis tight;

title( 'can-eth-gw performance' );
legend( "kernel udp->can", "kernel can->udp", "user udp->can",\
        "user can->udp");
xlabel( "can frame [id]" );
ylabel( "transmission duration [ns]" );

kern_mean = mean( [data(1,:) data(2,:)], 2 )
user_mean = mean( [data(3,:) data(4,:)], 2 )
printf( "kern_mean/user_mean=%f\n", kern_mean/user_mean );

end

