We propose for the first time the in-situ frequency discriminating and continuous phase-tuning of the microwave signal or pulse-train generated from directly modulated laser diode with respect to a free-running microwave clock by integrating a DC-voltage controlled optoelectronic phase shifter (OEPS) with the laser source. This technology facilitates the combination of the frequency synchronization and the phase shifting functions in one circuit. The transferred function of the phase shift versus the controlling voltage is linear with a maximum phase-tuning range and a tuning slope of up to 3.6π (640 o ) and 90 o /volt, respectively. The fluctuation and drift in phase of the controlled signal is about 0.05 o and 0.003 o /min. The tuning resolution of 0.2 o at a 3-mV increment of the controlling voltage is achieved by using a high-precision voltage regulator. Relative timing jitter of the controlled optical microwave clock is less than 5 ps. By using the delay-time tunable pulsed laser, we demonstrate for the first time the delay-line-free electro-optic sampling of the waveforms, which are RF sinusoidal and pulse signals with repetition rate of 500 MHz. The maximum sampling range and highest sampling resolution are about 1.9 periods and 0.2 ps/mV, respectively.