This is an old style R&B riff that could possibly be played with a barre chord but works much better if you use your left hand thumb to get the root note on the bottom string.
To start hold down a G major chord using the method outlined in lesson 2 of this tutorial - your first finger must cover the top 3 strings.
Hit the bottom part of the chord twice then flatten out your 4th finger to get a partial C chord at the 5th fret - you then have to take your 3rd and 4th fingers off in order to play the " blues trill ".
Your L/H thumb should keep holding down the bottom G note while playing this trill.
Your 1st finger keeps holding down the top three strings while your second finger does the rapid hammering on and off to get the trill.
I have tabbed out one bar on a G chord. The sound file has a whole 12 bar sequence in the key of G.
To get the other chords in the sequence you play exactly the same riff at fret 8 for C and fret 10 for D.
This text will be replaced
listen to the soundfile