What is the percentage of stars that are massive enough to end their lives in a supernova? I have been searching for the percentage of stars that are massive enough to end their lives as a supernova but couldn't get any result. 
As far as I know, a star has to be at least 8 times more massive than the sun to go supernova, so what is the percentage of stars that are more than 8 solar masses of all the stars in the observable universe ?
 A: What you are looking for is called the stellar mass function by astronomers. It is the distribution of masses for stars.
There is a nice review of the definitions, measurements, and basic theory in Galactic Stellar and Substellar Initial Mass Function, Chabrier 2003, PASP 115 763. It discusses both the initial mass function (IMF) and the present-day mass function (PDMF). The former is of more direct interest to those studying star formation, the latter is more directly observable.
Without getting caught up on the subtle differences between mass functions,1 the results in Table 1 of that paper give a workable mass function in terms of stellar mass $M$ divided by the mass of the Sun, $m = M/M_\odot$. After rearranging the equations to get rid of some potentially confusing logarithms, the mass function becomes
$$ \xi(m) =
\begin{cases}
\dfrac{A_\mathrm{low}}{m} \exp\left(-\dfrac{1}{2\sigma^2} \left(\log_{10}\left(\dfrac{m}{m_\mathrm{c}}\right)\right)^2\right), & m \leq 1 \\
A_\mathrm{high}\ m^{-x}, & m > 1;
\end{cases} $$
where $m_\mathrm{c} = 0.079$, $\sigma = 0.69$, $x = 2.3$, and the normalizations are $A_\mathrm{low} = 0.0686\ \mathrm{pc}^{-3}$ and $A_\mathrm{high} = 0.0192\ \mathrm{pc}^{-3}$.
Actually, the high-end power law can be made more accurate by breaking it into segments:
$$ \xi(m) =
\begin{cases}
A_1 m^{-x_1}, & 1 < m \leq 10^{0.54} \\
A_2 m^{-x_2}, & 10^{0.54} < m \leq 10^{1.26} \\
A_3 m^{-x_3}, & 10^{1.26} < m \leq 10^{1.80};
\end{cases} $$
with $x_1 = 5.37$, $x_2 = 4.53$, $x_3 = 3.11$, $A_1 = 0.019\ \mathrm{pc}^{-3}$, $A_2 = 0.0065\ \mathrm{pc}^{-3}$, and $A_3 = 1.1\times10^{-4}\ \mathrm{pc}^{-3}$.
From here we can integrate to find the absolute volume density of stars with $m > 8$. Using the broken power law I get
$$ n_{m>8} = \int_8^{10^{1.8}} \xi(m) \, \mathrm{d}m = 1.2\times10^{-6}\ \mathrm{pc}^{-3}. $$
The relative fraction of massive stars is obtained by dividing by the total number density in this model,
$$ n = \int_0^{10^{1.8}} \xi(m) \, \mathrm{d}m = 0.26\ \mathrm{pc}^{-3}, $$
yielding
$$ \chi_{m>8} = \frac{n_{m>8}}{n} = 4.3\times10^{-6}. $$

Note that there are many caveats here, and in fact this question is an active area of research. Finding the mass function is not an easy thing, especially at the low end. Low-mass stars are very faint, and so getting a handle on the statistics of such things is difficult. This means the relative fraction I calculated above is a lot more uncertain than the absolute density.
In fact, the low-end cutoff is something of a subjective thing. Do you count brown dwarfs (objects that can fuse deuterium but not hydrogen) as stars?
Additionally, the initial distributions of stellar masses are thought/hoped to be relatively independent of environment. Certainly, though, if you look close enough you will find that stars differ depending on where and when they formed. This touches upon a parameter I completely ignored - metallicity, the fraction of elements heavier than helium in a star. For instance, the extremely metal-poor early universe tended to form very massive stars moreso than most environments you find today. And metallicity can play a role in determining how massive a star needs to be to explode as a supernova.
Finally, it's not at all clear that all massive stars end in a traditional supernova. There are several rather distinct classes of core-collapse supernovae already known, and there are models in which certain massive progenitors hardly explode at all. Simulating the final hours of a massive star is an extremely challenging task that we're only now just beginning to get a handle on. For the above calculations, I simply used the $8\ M_\odot$ value you quoted, but others may argue different values are more appropriate, or that we should trim the final result to account for stars that don't explode.

1A note on initial versus present-day mass functions. The single, unbroken power law is a theoretical construct for the initial mass function. The three-part power law is a fit to data for stars as they are observed today. The calculation I did uses the latter, which is right if the question you have is "how many of the stars currently out there will eventually explode?"
But you could ask a slightly different question: "what fraction of stars being formed are doomed to explode?" Or even "what fraction of stars ever formed will explode?" These questions should use the initial mass function (or perhaps an integral of it over time). Then I get about $10\%$ of stars over $0.08\ M_\odot$ are over $1\ M_\odot$, not to different from this figure.
The reason for the discrepancy is that high-mass stars live very short lives, while essentially all stars less massive than the Sun ever formed still exist.
