Self-tuning Schedulers for Legacy Real-Time Applications