• Salva Peiró
  • Profile
  • Education
  • Publications
  • Projects
  • Archives



Measuring CPU Superscalar factor with noploop.c

by speiro - Sep 10, 2014 - Learning, noploop, programming, superscalar, performance,

While reading The noploop CPU Benchmark I decided to do a small experiment to calculate the CPU Superscalar factor, this consists in measuring the number of instructions that the CPU completes by cycle. That can be accomplished measuring the number of CPU cycles it takes to perform a fixed amount of NOPs (NO Operation) instructions, as shown below:

start = cpucycles()
perform 4096 * 100000000 NOPs
end   = cpucycles()

Superscalar CPU factor = (4096 * 10000000) / (end - start)

To measure the superscalar factor, we can write a small self-contained program (sources here: noploop.c) based on the above …

more ...

tac(1) command using mmap(2)

by speiro - Oct 14, 2013 - Learning, tac, programming,

Intro

A small and efficient tac(1) UNIX® filter application written while learning mmap(1). Using this as a base case more complex programs can programmed as: tail(1) and head(1).

Usage

The tac.c source code.

$ gcc -Wall tac.c -o tac
$ ./tac tac.c | ./tac
/*
 * $File: tac.c A small and efficient tac(1) using mmap(2)
 * $URL: http://speirofr.appspot.com/files/tac.c
 * $Author: Salva Peiró <speirofr@gmail.com> (c) Copyright 2014.
 * $License: GPLv2.
 */
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <sys/mman.h>

int main(int argc, char …
more ...

  Categories

  • CVEs
  • Infoleaks
  • Learning
  • Techniques

  Activity

  • SPADV-2018-01
  • CVE-2016-3178
  • CVE-2015-7885
  • CVE-2015-7884
  • CVE-2014-1739
  • CVE-2014-1446
  • CVE-2014-1445

  Contact

  • Linkedin
  • ResearchGate
  • Atom feed